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
Written by Kory Tegman
Related protips
2 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#