Can I cancel the animation of the <span> block when I click on the <div> button?
setInterval(function() { $("span").animate({ height: "90%" }, 1000).animate({ height: "30px" }, 1000); }); span { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; border: 1px solid #000; } div { position: absolute; top: 50%; left: 50%; margin: -25px 0 0 -25px; width: 50px; height: 50px; cursor: pointer; background: #f00; } <div></div> <span></span> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>