.dequeue( [queueName ] )Returns: jQuery

Description: Execute the next function on the queue for the matched elements.

When .dequeue() is called, the next function on the queue is removed from the queue, and then executed. This function should in turn (directly or indirectly) cause .dequeue() to be called, so that the sequence can continue.


Use dequeue to end a custom queue function which allows the queue to keep going.

<!doctype html>
<html lang="en">
  <meta charset="utf-8">
  <title>dequeue demo</title>
  div {
    margin: 3px;
    width: 50px;
    position: absolute;
    height: 50px;
    left: 10px;
    top: 30px;
    background-color: yellow;
  div.red {
    background-color: red;
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
$( "button" ).click(function() {
  $( "div" )
    .animate({ left:"+=200px" }, 2000 )
    .animate({ top:"0px" }, 600 )
    .queue(function() {
      $( this ).toggleClass( "red" ).dequeue();
    .animate({ left:"10px", top:"30px" }, 700 );


© The jQuery Foundation and other contributors
Licensed under the MIT License.