carousel组件可以实现走马灯的效果。有的时候需要实现自动轮播的功能。
查看carousel组件的api,有next()函数
Switches to the next card.
setInterval(function(){
myCrousel = Ext.ComponentQuery.query(‘carousel‘)[0];
myCrousel.next();
if (myCrousel.getActiveIndex() === myCrousel.getMaxItemIndex()) {
myCrousel.setActiveItem(0);
}
}, 3000);sencha touch笔记——Carousel组件自动滚动实现及代码,布布扣,bubuko.com
sencha touch笔记——Carousel组件自动滚动实现及代码
原文:http://blog.csdn.net/minedayu/article/details/20074175