开发者

Don't queue fadeTo(), fadeIn()/fadeOut()

开发者 https://www.devze.com 2023-03-18 23:53 出处:网络
I have the following animations: $(\'#id\').animate({\'margin-top\': 100, \'margin-left\':开发者_如何学运维 100}, {queue: false, duration: 1000});

I have the following animations:

$('#id').animate({'margin-top': 100, 'margin-left':开发者_如何学运维 100}, {queue: false, duration: 1000});
$('#id2').fadeTo(1000, 1);

this seems to be queuing, how can i make sure that fadeTo() doesn't queue?


Try:

$('#id2').stop().fadeTo(1000, 1);


Move the opacity change into the animation.

$('#id').css({opacity:0}).show().animate({marginTop: 100, marginLeft: 100, opacity:1}, 1000);

http://jsfiddle.net/vcBPR/

0

精彩评论

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