views:

766

answers:

3

I need a div to fade in when the page loads.

<div id=monster></div>

Im already using jquery FYI.

Thanks in advance.

+3  A: 

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.

CMS
Yes, edited....
CMS
works like a charm, thanks much. http://www.urlwee.com to see it in action
Patrick
+2  A: 

jQuery/fadeIn

$(function() {
    $("#monster").fadeIn();
});
Joe Chung
A: 

Cool. Works a treat. The .hide part is prety essential!

Alan