dconza
Last Updated: February 25, 2016
·
2.026K
· koryteg
3575018741e0d4a2214747708456797f

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

Say Thanks
Respond

2 Responses
Add your response

3665
D42a7264714dee5006b9c99d2567a320

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

over 1 year ago ·
3666
3575018741e0d4a2214747708456797f

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

over 1 year ago ·