Timeout jQuery Efffect


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

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');


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.