Example of .dequeue() in jQuery
May 01, 2013
.dequeue() in jQuery removes the next function in queue and then it is executed. Argument is optional but as arguments it takes queue name. Find the syntax with no argument.
.dequeue()
<!DOCTYPE html> <html> <head> <style> div { margin:3px; width:30px; position:absolute; height:30px; left:10px; top:30px; background-color:black; } </style> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> </head> <body> <button>Test Dequeue</button> <div></div> <script> $("button").click(function () { $("div").animate({left:200},4000); $("div").dequeue(); $("div").animate({top:100},4000); }); </script> </body> </html>
Output