jQuery Delay Plugin


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // Wait for #link to be clicked...
  2. $("#link").click(function(){
  3.  
  4. // Delay 1 second...
  5. $(this).delay(1000,function(){
  6.  
  7. // Then display #hello
  8. $("#hello").css("display","block");
  9.  
  10. // Then delay another 3 seconds...
  11. $(this).delay(3000,function(){
  12.  
  13. // Change text color to blue
  14. $("#hello").css("color","blue");
  15.  
  16. });
  17. });
  18. });

URL: http://www.evanbot.com/article/jquery-delay-plugin/4

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.