Differences JQuery 1.4.2 β†’ 1.4.3 Enough to break a good old image gallery †

after six attempts to beg the original javascript auhtor code to make it script compatible with newer jQuery libraries, all six are in vain, I decided it was time for me to fix this without him a seventh attempt, and getting rid of it otherwise worked fine (after numerous settings for me) image popup script.

Problem: It works when JQuery 1.3.2 ~ 1.4.2 loads , but NOT when JQuery 1.4.3 ~ 1.5.1 . In new builds, images do not increase after clicking on the thumbnails, whereas on old builds do!

Any suggestion / help is kindly appreciated and greatly appreciated by me. Thank!

The problem is here:

//display content
var displayContent = function(img) {
    if (visible) {
        var newImg = jQuery.extend(true, {}, img);
        resizeImg(newImg);

        var imgWidth = newImg.width;
        var imgHeight = newImg.height;
        var outerWidth = imgWidth + hBound;
        var outerHeight = imgHeight + vBound; 

        $lightbox.stop(true).animate({width:imgWidth, height:(imgHeight + cpHeight),
        left: Math.round(($(window).width() - outerWidth)/2),
        top:Math.round(($(window).height() - outerHeight)/2)}, 
        tranSpeed, 
        function() {
            enableCtrl();
            $innerBox.height(imgHeight);
            $info.html(langArrows + "  " + langImage + " " + (currIndex+1) + "/" + numItems);
            $cpanel.css({top:imgHeight, display:"block"});
            $mainImg.css({width:imgWidth, height:imgHeight})
            .attr("src", newImg.src).animate({opacity:1}, tranSpeed, startTimer);
            showDesc();
        }
        );
    }
}
+3
source share
1 answer

On line 336, add .show()to the end of the chain. While LekisS was on the correct answer, if you add it there, it will not be hidden correctly, so the next time you click on the image, you will see the image as a thumbnail for a short second.

+4
source

All Articles