Effect dequeue() Method - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:dequeue

Description

The dequeue() method removes and executes the next effect from the queue.

Syntax

Parameter Require Description Value
queueName Optional. name of the queue Default is "fx", the standard effects queue

The following code shows how to Remove the next function from the queue, and then execute the function:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("#start").click(function(){
        var div = $("div");
        div.animate({height: 300}, "slow");
        div.animate({width: 300}, "slow");
        div.queue(function () {
            div.css("background-color", "red");
            div.dequeue();
        });/*from   w w w.j  a  va2  s  .c o m*/
        div.animate({height: 100}, "slow");
        div.animate({width: 100}, "slow");
    });
});
</script>
</head>
<body>

<p><button id="start">Start Animation</button></p>

<div style="background:blue;height:100px;width:100px;">

</div>

</body>
</html>

Related Tutorials