日期:2014-05-16 浏览次数:20412 次
var carousel = new Carousel('#demo6', { effect: 'scrollx', easing: 'easeOutStrong', steps: 5, viewSize: [500], circular: false, prevBtnCls: 'prev', nextBtnCls: 'next', //autoplay:true,//是否自动切换 disableBtnCls: 'disable', lazyDataType: 'img-src' });
<!DOCTYPE HTML> <html> <head> <style> .s-demo{overflow:hidden;text-overflow:ellipsis; width:550px; height: 200px;} .ks-switchable-nav{position:relative; top: 20px; left: 200px;} </style> </head> <body> <div id="demo6" class="s-demo scrollable"> <ul class="ks-switchable-nav"> <li class="ks-active">•</li> <li>•</li> <li>•</li> </ul> <span id="scroller-prev" class="prev disable">‹ 上一页</span> <span id="scroller-next" class="next">下一页 ›</span> <div class="scroller"> <div class="ks-switchable-content"> <!-- 1-5 --> <img alt="" src="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" src="http://img02.taobaocdn.com/tps/i2/T1.XGaXalnXXXXXXXX-110-135.png"/> <img alt="" src="http://img04.taobaocdn.com/tps/i4/T1oEmXXmVoXXXXXXXX-110-135.png"/> <img alt="" src="http://img04.taobaocdn.com/tps/i4/T1oEmXXmVoXXXXXXXX-110-135.png"/> <img alt="" src="http://img03.taobaocdn.com/tps/i3/T1Hm1XXipvXXXXXXXX-110-135.png"/> <!-- 5-10 --> <img id='carousel_lazy1' alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <!-- 10-15 --> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> <img alt="" data-ks-lazyload-custom="http://img02.taobaocdn.com/tps/i2/T1l_yXXiFyXXXXXXXX-110-135.png"/> </div> </div> </div> </body> <script src="http://a.tbcdn.cn/s/kissy/1.3.0/kissy-min.js"></script> <script> KISSY.use("event,switchable,datalazyload,node", function(S, Event,Switchable) { var Carousel = Switchable.Carousel; S.ready(function(S) { //通过DOM元素新建旋转木马 var carousel = new Carousel('#demo6', { effect: 'scrollx', easing: 'easeOutStrong', steps: 5, viewSize: [500], ci