Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

jQuery | queue() with Examples

  • Last Updated : 13 Feb, 2019

The queue() method is an inbuilt method in jQuery which is used to show the queue of functions to be executed on the selected elements. In a queue one or more function wait for run.

  • The queue() method can be used with the dequeue() method.
  • An element may have several queues. Generally there is only one default jQuery queue.


Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!


Parameters: This method accepts single parameter queue_name which is optional. It is used to set the queue name.

Below example illustrates the queue() method in jQuery:


<!DOCTYPE html>
        <title>The queue Method</title>
        <script src=
        <!-- jQuery code to show the working of this method -->
            $(document).ready(function() {
                $("p").click(function() {
                    var div = $("div");
                        left: "+=200"
                    }, 2000);
                        height: 200
                    }, "slow");
                        width: 150
                    }, "slow");
                        height: 100
                    }, "slow");
                        width: 60
                    }, "slow");
                        left: "-=200",
                        top: "+=100"
                    }, 2000);
            div {
                width: 50px;
                height: 50px;
                position: absolute;
                left: 35px;
                margin-top: 10px;
                background-color: green;
            body {
                width: 500px;
                height: 250px;
                border: 2px solid green;
                padding: 20px;
        <p>The queue length is: <span></span></p>
        <!-- click on above paragraph to show the
        number of times animation method works -->

Before click on the paragraph element:

After click on the paragraph element:

My Personal Notes arrow_drop_up
Recommended Articles
Page :