Simple jQuery Timeout

0

I needed jQuery to fadeout an item after a certain timeout, and I found it odd that I couldn’t find a native jQuery way to do it.

Whatever. jQuery is so awesome that it doesn’t matter, because here’s what I came up with.

(function($){
$.doAfter = function(time,f) {
$('body').animate({ opacity: 1 }, time, f);
};
})(jQuery);
$(document).ready(function(){
$.doAfter(2500,function() {
$('.fadeout').fadeOut('slow');
});
});
Labels:
Loading related posts...

0 comments:

Post a Comment

2010 WEBSITE20. All rights reserved.