function mycarousel_itemVisibleInCallbackBeforeAnimation(carousel, item, idx, state) { // No animation on first load of the carousel if (state == 'init') return; jQuery('img', item).fadeIn('slow'); }; function mycarousel_itemVisibleOutCallbackBeforeAnimation(carousel, item, idx, state) { jQuery('img', item).fadeOut('slow'); }; var row = 1; function display(s) { if (row >= 1000) var r = row; else if (row >= 100) var r = ' ' + row; else if (row >= 10) var r = '  ' + row; else var r = '   ' + row; jQuery('#display').html(jQuery('#display').html() + r + ': ' + s + '
').get(0).scrollTop += 10000; row++; }; jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ scroll: 1, itemVisibleInCallback: { onBeforeAnimation: mycarousel_itemVisibleInCallbackBeforeAnimation }, itemVisibleOutCallback: { onBeforeAnimation: mycarousel_itemVisibleOutCallbackBeforeAnimation } }); });