186
rated 0 times
[
187]
[
1]
/ answers: 1 / hits: 54531
/ 15 Years ago, sun, august 2, 2009, 12:00:00
I'm using jQuery. I need a div to fade in when the page loads.
<div id=monster></div>
How can I achieve this?
More From » jquery
I'm using jQuery. I need a div to fade in when the page loads.
<div id=monster></div>
How can I achieve this?
It cannot be simpler:
$(function(){ // $(document).ready shorthand
$('#monster').fadeIn('slow');
});
If your div is not initially hidden, you could hide it before the animation:
$('#monster').hide().fadeIn('slow');
The speed parameter can be 'slow'
, 'normal'
, 'fast'
or the number of milliseconds to run the animation.