标题: 请问创建多个swiper有简单的方法吗? [打印本页] 作者: 雪白的心 时间: 2018-4-23 11:43 标题: 请问创建多个swiper有简单的方法吗? 必须一个一个写吗?请问有没有简单的创建多个swiper的办法?一行代码循环下去,要是有10个滚动是也得写10个吗?
var swiper1 = new Swiper('.swiper-container1');
var swiper2 = new Swiper('.swiper-container2');
var swiper3 = new Swiper('.swiper-container3');
var swiper4 = new Swiper('.swiper-container4');
var swiper5 = new Swiper('.swiper-container5');
var swiper6 = new Swiper('.swiper-container6');
......