English 中文(简体)
j 添加推延
原标题:jquery add delay to animation

我正试图在我的格凯中增加一个拖延,以便一旦摩擦离开我的遗嘱检验之后,它将等待3 000个ms,然后关闭。 但它似乎在发挥作用?

我正在使用Jquery 1.6。 min

事先感谢你的帮助和密码

$("#test").hover(function() {
    $(this).css({ z-index  :  10 });
    $(this).addClass("hover").stop()
        .animate({
            height:  60px 
        }, 1500);

    } , function() {
    $(this).css({ z-index  :  0 });
    $(this).delay(3000);
    $(this).removeClass("hover").stop() 
        .animate({
            height:  20px 
        }, 1500);
});
最佳回答

我认为,你需要把电话连接到第二组,或按顺序排列:

$("#test").hover(function() {
    $(this).css({ z-index  :  10 });
    $(this).addClass("hover").stop()
        .animate({
            height:  60px 
        }, 1500);

    } , function() {
    $(this).css({ z-index  :  0 })
       .delay(3000)
       .removeClass("hover")
       .stop() 
       .animate({
            height:  20px 
        }, 1500);
});
问题回答

野心是,你应当利用链条,使拖延生效

或者,在“独力手”中,你可以使用这样的东西:

function(){ setTimeout(function(){ .. perform what you need}, 3000);}

你们在错误的眼光中已经发生了拖延。 http://api.jquery.com/delay/“rel=“nofollow”

您本应当使用该守则:

$(this).removeClass("hover").stop().delay(3000) 
    .animate({
        height:  20px 
    }, 1500);

在此,我的例子有:





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签