<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>jquery Queue Animation </title>
<script src= "Https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" ></script>
<script src= "Http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" ></script >
<script>
$ (function () {
$ ("#star"). Click (function () {
Delay () Delayed execution
$ ("#text1").. animate ({"width": "+=200px"},2000, "Easeinoutquart", function () {
$ ("#text2"). Animate ({"width": "300px", "height": "200px", "Background-color": "Green"},2000,function () {
$ ("#text3"). Animate ({"width": "300px", "height": "100px"},2000,function () {
$ ("#text4"). Animate ({"width": "200px", "height": "100px"},2000);
});
});
});
});
$ ("#stop"). Click (function () {///to finish executing the current animation, then empty the queue animation after it
$ ("div"). Clearqueue ();
});
})
</script>
<style>
div{
width:100px;
height:50px;
Background-color:lightpink;
margin-bottom:10px;
}
</style>
<body>
<div id= "Text1" > Lexus </div>
<div id= "Text2" > Infiniti </div>
<div id= "Text3" > Cadillac </div>
<div id= "Text4" > BMW brilliance </div>
<button id= "star" > Start animation </button>
<button id= "Stop" > Stop animation </button>
</body>
jquery Queue Animations