autoplayPause(swiper)
回调函数,当自动切换(autoplay)暂停时执行。
如果
如果
如果
pauseOnMouseEnter处于启动状态而disableOnInteraction 处于关闭状态,鼠标移入后自动切换会暂停,此时会执行本函数。如果
pauseOnMouseEnter处于启动状态而disableOnInteraction 也处于启动状态,鼠标移入后自动切换会停止,此时会执行另一个函数autoplayStop(swiper)。autoplayPause(swiper)信息
- 类型:
 - function
 - 启用版本:
 - 8.0.0
 
效果演示
	正在自动切换
使用方法示例
从Swiper7开始,容器默认类名由'.swiper-container'变更为'.swiper'。
<script language="javascript"> 
  var mySwiper = new Swiper('.swiper',{
    autoplay: {
      pauseOnMouseEnter:true,
      disableOnInteraction:false,
    },
    on: {
      autoplayPause: function(){
        $("#showhtml").html('自动切换暂停了');
      },
      autoplayResume: function(){
        $("#showhtml").html('自动切换恢复了');
      },
    }
  })
</script>
转载原创文章请注明:文章转载自:Swiper中文网 [https://www.swiper.com.cn]
本文地址:https://www.swiper.com.cn/api/autoplay/496.html

 