function mycarousel_initCallback(carousel, state) { var i = 1; setInterval(function(){ console.log('test-'+i); //carousel.scroll(i); return; }, 2000); i++; }