Animate linear easing and call function after complete - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:animate

Description

Animate linear easing and call function after complete

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#btn").click(function(){
    $("#box").animate({
      height: "300px",
      width: "300px"
    }, {/*from  w  w  w  .j  a  v a 2s . co m*/
      duration: 5000,
      easing: "linear",
      complete: function(){
        $(this).after("<p>Animation is complete!</p>");
      }
    });
  });
});
</script>
</head>
<body>

<button id="btn">Animate height & width</button>

<div id="box" style="background:#98bf21;height:100px;width:100px;margin:6px;"></div>

</body>
</html>

Related Tutorials