I am using Flexslider to display items and their respective images.
What happens is that on page load, all li's are displayed first like a list with bullets. After a second, the plugin gets applied.
I tried hiding the original list (without plugin applied) through CSS
but didn't work.
Edit: I also tried document.ready. That didn't help either.
Edit: I am also OK with the solution that suggests to hide the content unless the plugin is applied.
Let me know if any other details are needed. Excuse me for English is not my first language.
Here is my code.
HTML:
<div id="slider" class="flexslider">
<ul class="slides">
<li>
<img src="slide1.jpg" />
</li>
<li>
<img src="slide2.jpg" />
</li>
<li>
<img src="slide3.jpg" />
</li>
<li>
<img src="slide4.jpg" />
</li>
<!-- items mirrored twice, total of 12 -->
</ul>
</div>
<div id="carousel" class="flexslider">
<ul class="slides">
<li>
<img src="slide1.jpg" />
</li>
<li>
<img src="slide2.jpg" />
</li>
<li>
<img src="slide3.jpg" />
</li>
<li>
<img src="slide4.jpg" />
</li>
<!-- items mirrored twice, total of 12 -->
</ul>
</div>
JS:
$(window).load(function() {
$('#carousel').flexslider({
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
itemWidth: 210,
itemMargin: 5,
asNavFor: '#slider'
});
$('#slider').flexslider({
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
sync: "#carousel"
});
});