Вот продолжение:
function animateBox() {
center.className = "";
$(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""});
$(sizer).width(preload.width);
$([sizer, prevLink, nextLink]).height(preload.height);
$(caption).html(images[activeImage][1] || "");
$(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length));
if (prevImage >= 0) preloadPrev.src = images[prevImage][0];
if (nextImage >= 0) preloadNext.src = images[nextImage][0];
centerWidth = image.offsetWidth;
centerHeight = image.offsetHeight;
var top = Math.max(0, middle - (centerHeight / 2));
if (center.offsetHeight != centerHeight) {
$(center).animate({height: centerHeight, top: top}, options.resizeDuration, options.resizeEasing);
}
if (center.offsetWidth != centerWidth) {
$(center).animate({width: centerWidth, marginLeft: -centerWidth/2}, options.resizeDuration, options.resizeEasing);
}
$(center).queue(function() {
$(bottomContainer).css({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""});
$(image).css({display: "none", visibility: "", opacity: ""}).fadeIn(options.imageFadeDuration, animateCaption);
});
}
function animateCaption() {
if (prevImage >= 0) $(prevLink).show();
if (nextImage >= 0) $(nextLink).show();
$(bottom).css("marginTop", -bottom.offsetHeight).animate({marginTop: 0}, options.captionAnimationDuration);
bottomContainer.style.visibility = "";
}
function stop() {
preload.onload = null;
preload.src = preloadPrev.src = preloadNext.src = activeURL;
$([center, image, bottom]).stop(true);
$([prevLink, nextLink, image, bottomContainer]).hide();
}
function close() {
if (activeImage >= 0) {
stop();
activeImage = prevImage = nextImage = -1;
$(center).hide();
$(overlay).stop().fadeOut(options.overlayFadeDuration, setup);
}
return false;
}
})(jQuery);
Простите , что так написал, просто места не хватило