As it stands there us a difference between the two and I want them to run at the same time. Here is the code:
$(selector1).animate({
height: '670'
}, 2000, function() {
// Animation complete.
});
$(selector2).animate({
top: '670'
}, 2000, function() {
// Animation complete.
});
解决方案
Using queue:false. You can see the full docshere.
$(selector1).animate({
height: '670'
}, {
duration: 2000,
queue: false,
complete: function() { /* Animation complete */ }
});
$(selector2).animate({
top: '670'
}, {
duration: 2000,
queue: false,
complete: function() { /* Animation complete */ }
});