Contents[hide] |
参数设置
默认参数
// default opts $.slider.defaults = { container: '.slides-container', btnNext: "", // Next button btnPrev: "", // Next button paginationClass: "", // page button current:'current', circular:false, effect:'default', // none|| default|| fade || easing:easeOutExpo || easing:easeOutSine || ... vertical:false, // default horizontal visible: 1, // visible count scroll:1, // scroll count fadeSpeed: 500, // fade speed slideSpeed: 350, // slide speed play: 0, // duration time pause: 0, // pause time hoverPause: true, // haover pause mouseWheel: false, // action mouse wheel paginationEvent:'click', // pagination event start: 1, // start on el eq() // preload: false, // preloadImage: '/img/loading.gif', // autoHeight: false, // autoHeightSpeed: 350, before: function() {}, callback: function() {} };
样式约定
参考示例
无效果
$('.demo0').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', paginationClass: '.num', paginationEvent:"mouseover", // page 按钮 事件 current:'on', // effect:'none', play: 1000, pause: 500, hoverPause: true// 划过是否停止 });
默认状态
$('.demo1').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', paginationClass: '.num', current:'on', // play: 1000, pause: 500, hoverPause: true // 划过是否停止 });
淡入
$('.demo2').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', paginationClass: '.num', current:'on', // effect:'fade' });
有导航 next prev
$('.demo3').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', paginationClass: '.num', current:'on' });
垂直
$('.demo4').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', vertical:true, paginationClass: '.num', current:'on' // });
多图,effect:'easing:easeInOutBack',无页按钮,循环滚动(长度:9,visible: 3, scroll:1)
$('.demo5').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', effect:'easing:easeInOutBack', visible: 3, // 显示多少个 scroll:1, // 滚动个数 circular:true });
多图,有页按钮,循环滚动(长度:9,visible: 3, scroll:3)
$('.demo6').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', paginationClass: '.num', current:'on', visible: 3, // 显示多少个 scroll:3, // 滚动个数 circular:true });
多图,无页按钮,循环滚动,鼠标滚动(长度:9,visible: 3, scroll:2,mouseWheel:true)
$('.demo7').slider({ container: '.slider-container', btnNext: '.next', btnPrev: '.prev', //paginationClass: '.num', //current:'on', visible: 3, // 显示多少个 scroll:3, // 滚动个数 circular:true, mouseWheel:true });
Changelog
- ~2013/01/08 : init commit
- ~2013/04/02 : reconstruct the code
- ~2014/05/01:support mouseWheel, optimize effect: none/fade implementation