Ensuring custom queues iterate correctly

When we create custom queues, the chained methods are not automatically called for us. This is something we need to do manually and is handled using the dequeue() method as we saw in the previous example.

When called, it will remove the next function in the queue and execute it. It's a simple method, with few arguments, and is used in a very specific manner. The method may take a single optional argument which is the name of the queue to execute the next function from:

jQuery(elements).dequeue([queue name]);

The queue name is only required if we are working with a queue other than the default fx queue. We didn't need to provide the name of the queue in the previous example in the last section because we replaced ...

Get jQuery 1.4 Animation Techniques Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.