var doArtSwiper = function(e,i){ var artOption = { pagination: '#swiper-pagination' + i, loop: true }; e = new Swiper('#' + e, artOption); }; $('.qir').each(function(){ doArtSwiper($(this).attr('id'),$(this).attr('id').charAt($(this).attr('id').length-1)); }); 忘记优化了 |
var doArtSwiper = function(e,i){ var hh = '#swiper-pagination' + i; console.log(hh); var artOption = { pagination: hh, loop: true }; artOption = Math.abs(window.orientation) === 90 ? $.extend({ spaceBetween: 8, slidesPerView: 2, centeredSlides: true }, artOption) : artOption; e = new Swiper('#' + e, artOption); }; $('.qir').each(function(){ var e = $(this).attr('id'); doArtSwiper(e,e.charAt(e.length-1)); }); 搞定,可参考上面的代码,往里面传值 |
少量应该怎么写啊,谢谢 |
admin 发表于 2015-4-30 19:25 少量确定的swipe可以用这种方法,如果swipe的个数不确定的话就难了 |
试一下每个分页器用不同的标签
|
Archiver|手机版|小黑屋|Swiper中文网 ( 粤ICP备15001020号 )
GMT+8, 2024-11-22 06:24 , Processed in 0.061626 second(s), 31 queries .
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.