Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"> </script> <style> .redDiv { background-color: red; height: 100px; width: 100px; } </style> <script> $(document).ready(function () { $('#myDiv').toggle(500); $('#myDiv').fadeOut(500); $('#myDiv').fadeIn(500); $('#myDiv').slideDown(500); $('#msgDiv').append('# of animation functions in a queue: ' + $('#myDiv').queue().length); }); </script> </head> <body> <h1>Demo: jQuery queue() method</h1> <div id="msgDiv"></div> <div id="myDiv" class="redDiv"> </div> </body> </html>
Result: