February 27, 2013
jQuery fade-out DIV display after certain set time
Question by Dan
I have the following code and would like to hide a DIV (.video-field-new
) after a specified amount of time after the page loads, for example 5 seconds. Is that possible?
<div id="BodyField">
<div class="video-field-new"></div>
</div>
And bonus if I could have it fade-out instead of just disappearing as the user will see this occurring.
Answer by dystroy
$(window).load(function(){
setTimeout(function(){ $('.video-field-new').fadeOut() }, 5000);
});