TA的每日心情 | 开心 2018-9-19 09:24 |
---|
签到天数: 1 天 [LV.1]初来乍到
新手上路
- 积分
- 22
|
slidesPerView: 'auto',
scrollContainer: true,
var Swiper1 = new Swiper('.sl-swiper',{
scrollContainer: true,
slidesPerView: 'auto',
});
//内容滚动
var Swiper2 = new Swiper('.swiper-container',{
scrollContainer: true,
});
Swiper1.params.control = Swiper2;//需要在Swiper2初始化后,Swiper1控制Swiper2
Swiper2.params.control = Swiper1;//需要在Swiper1初始化后,Swiper2控制Swiper1
然后 我把最上面的swiper1单独写了一个普通样式。
去控制swiper2
$('.top-w-title div').click(function(){
self=$(this);
$('.top-w-title div').removeClass('on');
self.addClass('on');
mySwiper.slideTo(self.index(), 300, false);
})
可以,但是swiper2怎么控制swiper1呢?
|
|