Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
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

 Answers
10

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.


[#99016] Tuesday, July 28, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dylondaytond

Total Points: 92
Total Questions: 88
Total Answers: 96

Location: China
Member since Fri, Jan 15, 2021
3 Years ago
dylondaytond questions
Tue, Jun 22, 21, 00:00, 3 Years ago
Thu, May 7, 20, 00:00, 4 Years ago
;