2

I love Jcarousel, but their method to allow a nice image slide is to preload images, and I want to save bandwidth and page loading time.

My goal: - First step should only load and display a single image. No second image should be loaded - When click on next or prev occurs, I want the image to be added via ajax, then have the slide effect.

In other words, I would like to be able to display a regular single image on my page, until the user click any of the prev or next button. this way if there is no click no useless image are loaded.

Anybody have tried this before ?

1 Answer 1

0

I have implemented jcaraousel,

I load only four images per page , when the user click i get the next four images.Do the following

1) get the no of images you want 2) when user clicks next , swap the existing image src with the next one.

If you want to give a loading effect , give a default loading gif image as a background image to those.We implemented the same at ...www.allposters.com , please check if you want a working demo.

3
  • I have looked at your example and I see that all your images are in the initial HTML, how do you manage to have the browser loading them only after the click on the next button ? :)
    – Philooo
    Dec 1, 2010 at 19:45
  • The trick is , if you see the future coming elements , they have ids as src , once you click next the src will be swapped with ids , ids are nothing but imagesource
    – kobe
    Dec 1, 2010 at 19:49
  • I just hoep someone out there had made something even cleaner :) where the image can be loaded after the click but before the slide happen, that way I can have the nice slide with loaded images, without the cost of preloading ;)
    – Philooo
    Dec 1, 2010 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.