I made a horizontal slider using iScroll.
I want to show a lot of images (or divs), and I added those images like this:
<ul>
<li style="background: url(fotos/PabloskiMarzo2008.jpg) no-repeat; background-size: 100%; -moz-background-size: 100%; -o-background-size: 100%; -webkit-background-size: 100%; -khtml-background-size: 100%; "></li>
...
<ul>
But it gets a lot of time to load every image (instead of images I'm going to use images map or divs).
How can I do that load images on demand? When user swipes to left, I want to load the next image.
You might as well put most of that CSS in a class that affects the elements so you don't have to add it inline to each element:
JS --
CSS --