Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery fade element does not show elements styled 'visibility: hidden'

I have a bunch of thumbnails which I am loading with a style of visibility: hidden; so that they all maintain their correct layouts. Once the page is fully loaded I have a jquery function that fades them in. This worked when their style was set to display: none; but obviously the layout screwed up then. Any suggestions?

Heres the fade line:

$('.littleme').fadeIn('slow'); 
like image 554
kalpaitch Avatar asked Mar 12 '10 20:03

kalpaitch


1 Answers

Add a few calls to the chain like this:

 $('.littleme').css('visibility','visible').hide().fadeIn('slow'); 

This will change it to display:none for 1 frame before fading in, occupying the area again.

like image 99
Nick Craver Avatar answered Oct 22 '22 12:10

Nick Craver