JQuery to fade into .after ()?

Simple but can't make it work, here is my script ...

$('body').after('<div id="lightBox" style="height: ' + htmlHeight + 'px;"></div>'); 

How can I make it disappear, and not just pop up? put fadeIn() after or before .after() doesn't work?

+7
source share
3 answers
 $('body').after('<div id="lightBox" style="height: ' + htmlHeight + 'px; display:none;"></div>'); $('#lightBox').fadeIn(); 
+4
source
 $('body').after('<div id="lightBox" style="height: ' + htmlHeight + 'px;"></div>'); $("#lightBox").hide().fadeIn(); 

He hides it and then disappears in

+3
source

Shortcut:

 $('body').after($('<div id="lightBox" style="height: ' + htmlHeight + 'px;"></div>').hide().fadeIn()); 
0
source

All Articles