开发者

Differences JQuery 1.4.2 → 1.4.3 Enough to break good old image gallery †

after exaclty six attempts begging the original auhtor of an image popup javascript code to make his script compatible with the newer JQuery libraries, all six in vain, I decided its time for me to fix it without him the seventh attempt, and salvage this otherwise perfectly working (after numerous customisations by me) image popup script.

Problem: works when JQuery 1.3.2 ~ 1.4.2 is loaded, but NOT when JQuery 1.4.3 ~ 1.5.1 is loa开发者_如何学Pythonded. On new builds, images don't enlarge after click on the thumbnails, whereas on the old builds, the do!

Any suggesion/help is kindly welcome and appreciated by me highly. Thanks!

The problem lies somehwere 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();
        }
        );
    }
}


On line 336 add .show() to the end of the chain. While LekisS was on to the right answer, if you add it there, its not properly hidden so the next time you click the image you will see the image display as its thumbnail size for a brief second.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜