Posted By

Meander365 on 08/18/10


Tagged

javascript time jquery delay setTimeout


Versions (?)

Timeout jQuery Efffect


 / Published in: jQuery
 

A small plugin that you can use in the jQuery chain to delay the next in queue. For those using a jQuery library pre 1.4 (v1.4 + has .delay() ).

$('.notice').fadeIn().idle(2000).fadeOut('slow');

  1. (function($){
  2.  
  3. jQuery.fn.idle = function(time)
  4. {
  5. var o = $(this);
  6. o.queue(function()
  7. {
  8. setTimeout(function()
  9. {
  10. o.dequeue();
  11. }, time);
  12. });
  13. };
  14. })(jQuery);

Report this snippet  

You need to login to post a comment.