jquery - bx slider loads broken the snaps into place -


in browsers bxslider loads without styling , shows levels, , shifted left until script kicks in , snaps place.

i tried setting div in style="display:none" , lower on page place $(document).ready(function(){ $('#div-id').css({'display': 'block'}).animate(); }); have tried several different syntax life of me can't work. see obvious or have idea

thanks

do this

$('#div-id').css('display','block'); 

rather than

$('#div-id').css({'display': 'block'}).animate(); 

html:

<div id="div-id"><ul class="slider"><li><a rel="gallery" href="img/carousel/1.jpg"><img src="img/carousel/1.jpg" width="170" height="150" /></a></li></ul></div> 

css:

#div-id {display: none} 

js:

$(document).ready(function() { $('#div-id').css('display','block'); }); 

alternatively, in example using ul tag, following works equally well: html (no need div):

<ul class="slider"><li><a rel="gallery" href="img/carousel/1.jpg"><img src="img/carousel/1.jpg" width="170" height="150" /></a></li></ul> 

css:

.slider ul {    display:none;   } 

js:

$(document).ready(function() {      $('.slider ul').css('display','block');  }); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -