breakpointsInverse
开启后,breakpoints将以反方向计算,类似于media only screen and (min-width: 480px)
Swiper5.0.0 后弃用该属性,并默认 breakpointsInverse: true
Swiper5.0.0 后弃用该属性,并默认 breakpointsInverse: true
breakpointsInverse信息
- 类型:
- boolean
- 默认:
- false
- 举例:
- true
- 启用版本:
- 4.0.0
使用方法示例
从Swiper7开始,容器默认类名由'.swiper-container'变更为'.swiper'。
<script>
var swiper = new Swiper('.swiper', {
slidesPerView: 1,
spaceBetween: 40,
breakpointsInverse: true,
breakpoints: {
//当宽度大于等于320
320: {
slidesPerView: 2,
spaceBetween: 10
},
//当宽度大于等于480
480: {
slidesPerView: 3,
spaceBetween: 20
},
//当宽度大于等于640
640: {
slidesPerView: 4,
spaceBetween: 30
}
}
})
</script>
转载原创文章请注明:文章转载自:Swiper中文网 [https://www.swiper.com.cn]
本文地址:https://www.swiper.com.cn/api/abandon/428.html