How to preload images using jquery for carousel?

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-04-13T06:36:10Z Indexed on 2010/04/13 6:53 UTC
Read the original article Hit count: 374

Filed under:
|
|

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.....

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about preload