Forums Carousel

Carousel Ajax / without page reload

Subscribe to Carousel Ajax / without page reload 2 post(s), 2 voice(s)

 
Avatar jam08 5 post(s)

Hi i am loading the Carousel with Ajax but I can’t clear the
carousel and reload a new array without having to reload the page.
The data is always appended to the carousel.
Any clues?
thanks

 
Avatar taavi 1 post

You have to recreate the placeholder divs, destroy() seems to wipe them all the way out:

function swapCalendar(carouselUrl){
uicarousel.destroy();
$('carousel_wrapper_div').innerHTML='<div id="horizontal_carousel"><div class="prev_btn"></div><div class="container"><ul></ul><div id="spinner" style="opacity: 0; display: none;">Loading ...<br></div></div><div class="next_btn"></div></div>';
uicarousel = new UI.Ajax.Carousel("horizontal_carousel", {url: carouselUrl, elementSize: 350});

Carousel itself:
<div id='carousel_wrapper_div'><div id="horizontal_carousel">...</div></div>

Forums Carousel