примерно так:
$('#right_slider_3 .overflow ul li a').click(function () {
$('#right_slider_3 .overflow ul li.active').removeClass('active');
$(this.parentNode).addClass('active');
var ig = new Image();
if ($.browser.msie && $.browser.version < 8) {
ig.src = $(this).attr('href') + "?" + new Date().getTime();
}
else {
ig.src = $(this).attr('href');
}
var $anchor = $('<a/>').append(ig).attr({'rel': 'example_group','href': ig.src}).hide();
$('#right_slider_3 .big_foto .img').prepend($anchor);
$anchor.fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none',
'titlePosition' : 'over',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>';
}
});
$(ig).load(function () {
$('#right_slider_3 .big_foto .img a').eq(1).remove();
$('#right_slider_3 .big_foto .img a').eq(0).animate({'opacity':'show'}, 500);
})
return false
});