Posted By

math89 on 07/09/10


Tagged

time hide delay


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

legacye
dhollifield
wattsupnow


Automatically hide or close elements after an amount of time (jQuery)


 / Published in: jQuery
 

URL: http://codesnippets.info/jquery/automatically-hide-or-close-elements-after-an-amount-of-time/

Automatically hide or close elements after an amount of time (jQuery)

  1. //Here's how we used to do it in 1.3.2 using setTimeout
  2.  
  3. setTimeout(function() {
  4. $('.mydiv').hide('blind', {}, 500)
  5. }, 5000);
  6.  
  7.  
  8.  
  9. //And here's how you can do it with 1.4 using the delay() feature (this is a lot like sleep)
  10.  
  11. $(".mydiv").delay(5000).hide('blind', {}, 500);

Report this snippet  

You need to login to post a comment.