问题
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