control
设置为另外一个Swiper实例开始控制该Swiper。
control参数
- 类型:
- [Swiper Instance]
- 默认:
- null
- 举例:
- myswiper
- 启用版本:
- 3.0.0
效果演示
Swiper1
Swiper2
使用方法示例
<script>
var Swiper1 = new Swiper('#swiper-container1',{
})
var Swiper2 = new Swiper('#swiper-container2',{
})
Swiper1.params.control = Swiper2;//需要在Swiper2初始化后,Swiper1控制Swiper2
Swiper2.params.control = Swiper1;//需要在Swiper1初始化后,Swiper2控制Swiper1
var Swiper3 = new Swiper('#swiper-container3',{
control: [Swiper1, Swiper2],//控制前面两个Swiper
})
</script>
转载原创文章请注明:文章转载自:Swiper中文网 [https://3.swiper.com.cn]
本文地址:https://3.swiper.com.cn/api/Controller/2015/0308/216.html