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

筅森魡賤 提交于 2019-12-10 18:15:28

问题


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?


回答1:


Try:

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



回答2:


Move the opacity change into the animation.

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

http://jsfiddle.net/vcBPR/



来源:https://stackoverflow.com/questions/6640929/dont-queue-fadeto-fadein-fadeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!