How to preload images using jquery for carousel?
- by Pandiya Chendur
I used jquery stepcarousel plugin and it works fine... But how to preload images that is used by the plugin... I am using this,
<div id="mygallery" class="stepcarousel">
<div class="belt">
<div class="panel">
<img src="Images/img1.jpg" />
</div>
<div class="panel">
<img src="Images/img2.jpg" />
</div>
</div>
</div>
<script type="text/javascript">
stepcarousel.setup({
galleryid: 'mygallery', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'panel', //class of panel DIVs each holding content
autostep: { enable: true, moveby: 1, pause: 3000 },
panelbehavior: { speed: 500, wraparound: false, persist: true },
defaultbuttons: { enable: true, moveby: 1, leftnav: ['Images/lft_arrow.jpg', -5, 220], rightnav: ['Images/rit_arrow.jpg', -5, 220] },
statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
contenttype: ['inline'] //content setting ['inline'] or ['ajax', 'path_to_external_file']
})
</script>
How to preload images used by mygallery div such that i can avoid flickering.....