0

読んでくれてありがとう。以前にクリックした画像を閉じるようにJqueryNivoZoomプラグインを変更しようとしています。

現在の動作はここで確認できます:http://nivozoom.dev7studios.com/

プラグインが行うことは、サムネイルをクリックすると大きな画像を開きますが、前のクリックを開いたままにします。私が言ったように、前にクリックした画像を閉じるように変更したいと思います。

コードを調べると、コードのこの部分に何かを追加する必要があると思います。

function doZoom(img, link, nivoZoomHover){
            var imgLarge = $('img.nivoLarge', link);
            if(link.hasClass('zoomed')){
                //Hide Overlay
                if(settings.overlay) $('#nivoOverlay').fadeOut(settings.speed/2);
                //Hide Caption
                if($('.nivoCaption', link).length > 0){
                    $('.nivoCaption', link).fadeOut(settings.speed/2);
                }
                //Hide Image
                imgLarge.fadeOut(settings.speed/2, function(){
                    img.animate({ opacity:1 }, settings.speed/2);
                });
                link.removeClass('zoomed');
            } else {
                //Show Overlay
                if(settings.overlay) $('#nivoOverlay').fadeIn(settings.speed/2);
                //Hide ZoomHover
                nivoZoomHover.css('opacity','0');
                //Show Image
                img.animate({ opacity:0 }, settings.speed/2, function(){
                    imgLarge.fadeIn(settings.speed/2, function(){
                        showCaption(img, imgLarge, link);
                    });
                });
                link.addClass('zoomed');
            }
        }

しかし、私はいくつかのことを試しましたが、今のところうまくいきませんでした。誰でも助けることができますか?

どうもありがとうございます。

4

1 に答える 1

0

行#67周辺-'link.bind(' click'、function(){'の直後

以下を貼り付けます。

var notThis = $(".nivoCaption").not($(".nivoCaption", link));
notThis.closest("a").removeClass("zoomed");
notThis.removeClass("nivo-processed");
notThis.css("display","none");
notThis.parent().children("img").not($("img.nivoLarge")).css("opacity","1");
$(".nivoLarge").not($("img.nivoLarge", link)).fadeOut(settings.speed/2);

おそらくもっと良い方法がありますが、うまくいくようです。

次に気になるのは、以前にズームしたサムネイルの後ろに表示されるズームした画像のIE9z-indexの問題です。行#185かそこらに移動し、「IE7フィックス」を見つけて、3行が機能していることをコメントします。その「修正」はIE9のz-indexを壊します。(しかし、IE7の問題を復活させるつもりです)。

于 2012-06-17T03:58:51.877 に答える