<html>
<head>
<script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
var div = $("div");
div.animate({height:300},"slow");
div.animate({width:300},"slow");
div.animate({height:100},"slow");
div.animate({width:100},"slow");
$("span").text(div.queue().length);
});
});
</script>
</head>
<body>
<button>Start Animation</button>
<p>The queue length is: <span></span></p>
<div style="width:50px;height:50px;position:absolute;left:10px;top:100px;background-color:red;"></div>
</body>
</html>