开发者

JQUERY animate Delay?

开发者 https://www.devze.com 2023-01-06 18:37 出处:网络
I\'m using JQUERY animate to show a ban开发者_运维技巧ner at the top of the page, which is a DIV that is set to top -60 to hide it. I\'m using the following JS call to show the div:

I'm using JQUERY animate to show a ban开发者_运维技巧ner at the top of the page, which is a DIV that is set to top -60 to hide it. I'm using the following JS call to show the div:

// Animation
$('#message-dock').animate({
    top: 0
}, 500, function() {
    // Animation complete.
});

What I can't figure out is for some reason there is an unwanted delay before I start seeing the div and I can't figure out why? Any Ideas?


Why not just set the css of the div to display:none; and then use $("#message-dock").show('slow'); when you want to show it? Works without 'slow', or with 'fast' too.

0

精彩评论

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