By default the jQuery queue that is created for animate() is done per element, I\'m wondering if there is a way to create a single queue for all animations done with animate()?
Something like this:
$(someElement) // could also be a plain object, e.g. $({})
.queue('customQueue', function (next) {
first.animate({ ... }, function () {
// when the animation is complete, call next() for customQueue
next();
});
})
.queue('customQueue', function (next) {
second.animate({ ... }, function () {
// when the animation is complete, call next() for customQueue
next();
});
})
// add more animations, then
.dequeue('customQueue');