Swiper Autoplay(自动播放) - autoplayResume(swiper)

回调函数,当自动切换(autoplay)从暂停状态恢复运行时执行。
如果pauseOnMouseEnter 启动而disableOnInteraction 关闭,鼠标移出后自动切换会恢复,此时会执行本函数。
如果pauseOnMouseEnter启动而disableOnInteraction 也启动,鼠标移入后自动切换会停止,鼠标移出后自动切换无法恢复。

autoplayResume(swiper)信息

类型:
function
启用版本:
8.0.0

效果演示

slider1
slider2
slider3
正在自动切换

使用方法示例

从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>