var mycarousel_itemList = [ {url: '../photos/vignettes/collec_locales/ascenseurs.jpg', title: 'ascenseurs', zoom: '../photos/zoom/collec_locales/ascenseurs.jpg'}, {url: '../photos/vignettes/collec_locales/collec1.jpg', title: 'collec1', zoom: '../photos/zoom/collec_locales/collec1.jpg'}, {url: '../photos/vignettes/collec_locales/collec2.jpg', title: 'collec2', zoom: '../photos/zoom/collec_locales/collec2.jpg'}, {url: '../photos/vignettes/collec_locales/collec3.jpg', title: 'collec3', zoom: '../photos/zoom/collec_locales/collec3.jpg'}, {url: '../photos/vignettes/collec_locales/collec4.jpg', title: 'collec4', zoom: '../photos/zoom/collec_locales/collec4.jpg'}, {url: '../photos/vignettes/collec_locales/collec5.jpg', title: 'collec5', zoom: '../photos/zoom/collec_locales/collec5.jpg'}, {url: '../photos/vignettes/collec_locales/collec6.jpg', title: 'collec6', zoom: '../photos/zoom/collec_locales/collec6.jpg'}, {url: '../photos/vignettes/collec_locales/collec7.jpg', title: 'collec7', zoom: '../photos/zoom/collec_locales/collec7.jpg'}, {url: '../photos/vignettes/collec_locales/collec8.jpg', title: 'collec8', zoom: '../photos/zoom/collec_locales/collec8.jpg'}, {url: '../photos/vignettes/collec_locales/interieur_chatelets2.jpg', title: 'interieur_chatelets2', zoom: '../photos/zoom/collec_locales/interieur_chatelets2.jpg'}, {url: '../photos/vignettes/collec_locales/langueux.jpg', title: 'langueux', zoom: '../photos/zoom/collec_locales/langueux.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} }); });