var mycarousel_itemList = [ {url: '../photos/vignettes/concept/assemblage-leclerc.jpg', title: 'assemblage-leclerc', zoom: '../photos/zoom/concept/assemblage-leclerc.jpg'}, {url: '../photos/vignettes/concept/eclairage-leclerc.jpg', title: 'eclairage-leclerc', zoom: '../photos/zoom/concept/eclairage-leclerc.jpg'}, {url: '../photos/vignettes/concept/leclerc-guingamp.jpg', title: 'leclerc-guingamp', zoom: '../photos/zoom/concept/leclerc-guingamp.jpg'}, {url: '../photos/vignettes/concept/leclerc.jpg', title: 'leclerc', zoom: '../photos/zoom/concept/leclerc.jpg'}, {url: '../photos/vignettes/concept/totem-casino1.jpg', title: 'totem-casino1', zoom: '../photos/zoom/concept/totem-casino1.jpg'}, {url: '../photos/vignettes/concept/totem-casino2.jpg', title: 'totem-casino2', zoom: '../photos/zoom/concept/totem-casino2.jpg'}, {url: '../photos/vignettes/concept/totem-casino3.jpg', title: 'totem-casino3', zoom: '../photos/zoom/concept/totem-casino3.jpg'}, {url: '../photos/vignettes/concept/totem-casino4.jpg', title: 'totem-casino4', zoom: '../photos/zoom/concept/totem-casino4.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} }); });