replaceState
使用replaceState(window.history.replaceState)方法代替hashnav的hash方法(document.location.hash)或者history的pushState(window.history.replaceState)方法。
replaceState参数
- 类型:
- boolean
- 默认:
- false
- 举例:
- true
- 启用版本:
- 3.4.0
使用方法示例
<script language="javascript">
var mySwiper = new Swiper('.swiper-container',{
hashnav:true,
//or history:'slides',
replaceState:true,
})
</script>
转载原创文章请注明:文章转载自:Swiper中文网 [https://3.swiper.com.cn]
本文地址:https://3.swiper.com.cn/api/basic/2016/1030/319.html