onlyInViewport
默認僅控制當前窗口內的swiper切換。當swiper離開可視區域則無法切換。
onlyInViewport信息
- 類型:
- boolean
- 默認:
- true
- 舉例:
- false
- 啟用版本:
- 4.1.0
效果演示
禁止后,即使swiper不在可視區域也能鍵盤控制切換
使用方法示例
<script language="javascript">
var mySwiper = new Swiper('.swiper-container',{
keyboard: {
enabled: true,
onlyInViewport: false,
},
})
</script>
轉載原創文章請注明:文章轉載自:Swiper中文網 [https://www.swiper.com.cn]
本文地址:https://www.swiper.com.cn/api/keyboard/413.html
上一篇:enabled
下一篇:沒有了