Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't know if this will help you, but the concept is to load the images in javascript, not in HTML because you could not prevent loading everything if it is in HTML.</p> <p>Look at my answer to this question: </p> <p><a href="https://stackoverflow.com/questions/3949913/jquery-simple-image-slider-w-ajax/3949945#3949945">jquery simple image slider w/ajax</a></p> <p>"I think you can do that with jcarousel: </p> <p><a href="http://sorgalla.com/jcarousel/" rel="nofollow noreferrer">http://sorgalla.com/jcarousel/</a></p> <p>The trick is to pass the images one by one in javascript, not in html, if not, they are always loaded beforehand.</p> <p>The code would be:</p> <pre><code>var mycarousel_itemList = [ {url:"/im/a.jpg", title: ""},{url:"/im/b.jpg", title: ""}]; listaimg=document.createElement('ul'); jQuery(listaimg).attr('id','mycarousel'); jQuery(listaimg).addClass('jcarousel-skin-tango'); jQuery('#containercarousel').append(listaimg); jQuery('#mycarousel').jcarousel({ auto: 9,wrap: 'last', visible: 1,scroll:1, size: mycarousel_itemList.length, itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback} }); function mycarousel_itemLoadCallback(carousel,state){for(var i=carousel.first;i&lt;=carousel.last;i++){if(carousel.has(i)){continue}if(i&gt;mycarousel_itemList.length){break}; carousel.add(i,mycarousel_getItemHTML(mycarousel_itemList[i-1])); } }; function mycarousel_getItemHTML(item) { var img = new Image(); $J(img).load(function () { // whatever you want to do while loading. }).attr('src', item.url); return "&lt;li&gt;&lt;img src=\"" + item.url + "\" width=\"770\" alt=\"\" /&gt;&lt;/li&gt;"; } </code></pre> <p>"</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload