var mycarousel_itemList = [ {url: '../photos/vignettes/tampons/tamp1.jpg', title: 'tamp1', zoom: '../photos/zoom/tampons/tamp1.jpg'}, {url: '../photos/vignettes/tampons/tamp2.jpg', title: 'tamp2', zoom: '../photos/zoom/tampons/tamp2.jpg'}, {url: '../photos/vignettes/tampons/tamp3.jpg', title: 'tamp3', zoom: '../photos/zoom/tampons/tamp3.jpg'}, {url: '../photos/vignettes/tampons/tamp4.jpg', title: 'tamp4', zoom: '../photos/zoom/tampons/tamp4.jpg'}, {url: '../photos/vignettes/tampons/tamp5.jpg', title: 'tamp5', zoom: '../photos/zoom/tampons/tamp5.jpg'}, {url: '../photos/vignettes/tampons/tamp6.jpg', title: 'tamp6', zoom: '../photos/zoom/tampons/tamp6.jpg'}, {url: '../photos/vignettes/tampons/tamp7.jpg', title: 'tamp7', zoom: '../photos/zoom/tampons/tamp7.jpg'}, {url: '../photos/vignettes/tampons/tamp8.jpg', title: 'tamp8', zoom: '../photos/zoom/tampons/tamp8.jpg'}]; function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt){ // The index() method calculates the index from a // given index who is out of the actual item range. var idx = carousel.index(i, mycarousel_itemList.length); carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1])); // Pause autoscrolling if the user moves with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); }; function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt){ carousel.remove(i); }; /** * Item html creation helper. */ function mycarousel_getItemHTML(item){ var item = '' + item.title + ''; $('a.thickbox').unbind("click"); tb_init('a.thickbox'); return item; }; $(document).ready(function() { $('#cadre_diapo').jcarousel({ scroll : 1, auto : 2, animation : "slow", wrap : "circular", itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback}, itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback} }); });