Execute complete function only once in jQuery animation - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:animate

Description

Execute complete function only once in jQuery animation

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from w  ww .  ja va 2 s  . c o m
$.when($("p").delay(500).animate({
    "font-size": "+=50"
}, 1000)).done(function(){
    console.log("done");
});
    });

      </script> 
   </head> 
   <body> 
      <p>Lorem</p> 
      <p>Lorem</p>  
   </body>
</html>

Related Tutorials