Skip to main content

.animate() queue option explanation



from http://api.jquery.com/animate/ :







queue: A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.







I want that the animations added to an object should be start when the last animation ends. From the jquery doc it seems to me that, in order to achieve this, the animation must added to a queue. if I pass {queue: true} the animation is added to the general queue, while in jQuery 1.7 I can pass {queue: "queue_foo"} to add the animation to a certain queue. I wrote this in my code, but the animation is not executed.







showedSlide.animate({

left: -showedSlide.outerWidth()

}, {queue: "left"});




Comments

  1. The default queue ('fx') gets dequeued immediately whenever a new action gets queued, custom queues do not. You have to dequeue() them yourself.

    I suspect, however, that you tried the default queue, it didn't work and so you turned to custom queues, because unless you specify queue: false animations do get queued up, and the next animation waits for the previous one to complete before it can begin. But this only applies to animations on a single element. If you have 2 animations on 2 different elements, they'll execute in parallel.

    Does your showedSlide always refer to the same element or does it change?

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?