Is there any difference if I do:
$queue.queue(function(next){
//...
next();
}).queue(function(next){
//...
next();
});
versus
There isn't much difference. next()
simply calls .dequeue()
with variables held in a closure (source):
var ...,
next = function () {
jQuery.dequeue( elem, type );
};
I'd say to use next()
as it just means less you have to do, since it already has what you need for .dequeue()
-- the elements and queue name (or type
).