Last Updated: February 25, 2016
·
2.584K
· koryteg

Simultaneous events with Queue: false

{queue: false} could be your friend when chaining animate() to events.

I was toggling a show and hide but wanted to add more custom animation to it. looked like this

$(this).show("slow").animate({
    left: "+=400px",
}, "slow");

this chain fires off show() and when it is done, then fires off animate().

by adding queue:false, they fire at the same time. syntax looks like this

$(this).show("slow").animate({
    left: "+=400px",
}, {queue: false, duration: "slow"});

check out the jQuery api for more on animate and queue

2 Responses
Add your response

I was always wondering why isn't it the default behavior in jQuery...

over 1 year ago ·

@dpashkevich yeah it seems like the most common use case.

over 1 year ago ·