I’m working on a gallery with jCarousel.
I’ve created a script that loads the next images to the gallery each time I click on the next button from an array. Each time I click next, the next five images are loaded. It all works really great, but my problem is that I see the empty
I tried two solutions :
1) add a delay to the animation – after the
The interesting thing is that if I add an alert, when I dismiss it the images are already loaded and the animation is perfect – as if the code keeps running and the images are loaded – except the animation starts only after the alert is closed.
2) I tried to load the images to some invisible caching div, but of course I have to make it display:none, and again the same, the images are not loaded until the animation starts (and images are turned to display: block …
this is the line, event and function name I use to load the images:
itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
I know this might be insufficient input and code, but the script became very long so if a specific part could be usefull (or all of it?) just let me know… I don’t want to clutter the message 🙂
Thanks for reading this,
Yan
I accomplished this by doing the following:
e.g.
Note: this isn’t complete working code; it was edited to down for clarity. Also, keep in mind, the data I’m passing in to
addItems()is array of json objects, each of which contains an ImageUrl property.