Is there any way to fadeout a div after 5 Seconds without using a setTimeOut function?
Case 1: if you want to start fadeOut after 5 seconds, use this:
jQuery.fn.delay = function(time,func){
return this.each(function(){
setTimeout(func,time);
});
};
Then, use it like this:
$('#div').delay(5000, function(){$(#div').fadeOut()})
You can't achieve this without using setTimeOut at all
Case 2: if you want the duration of fadeOut to be 5 seconds, use this:
$('#div').fadeOut(5000)