0

http://www.wearewebstars.dk/frontend/Borneunivers/boerneunivers.htmlを見て 、左側のナビゲーションをクリックし始めると、ナビゲーションのリンクをクリックすると、あなたの元のリンク - アイデアはありますか? 私が持っているスクリプトは次のとおりです。

//Left navigation Animation
            $(".left-navigation ul li").hover(function(){
                if($(this).hasClass('current')){

                } else {
                    $(this).animate({'width': '95%'}, 100, function() {
                        $(this).find("span.nav-text").delay(100).css("display", "inline-block");
                    });
                }
            }, function(){  
                if($(this).hasClass('current')){

                } else {
                    $(this).animate({'width': '35px'}, 0, function() {
                        $(this).find("span.nav-text").css("display", "none");
                    });
                }
            });
4

2 に答える 2

0

.stop()追加のアニメーションを中断して構築するには、アニメーション キューを使用する必要があります。

http://jsbin.com/oxisal/1/

$(".left-navigation ul li:not(.current)").hover(function( e ){

     var mEnt = e.type=="mouseenter"; // boolean true/false

     $(this).stop().animate({width: mEnt?'95%':35}, mEnt?100:0, function() {
         $(this).find("span.nav-text").css({
             display: mEnt? "inline-block" : "none"
         });
     });

});

あなた.stop()もクリックする必要があります

于 2013-08-05T17:42:57.130 に答える