swiper轮播器的常用案例分析(swiper hover停止mouseover停止)

API地址

基础演示

 技术分享

hover停止需要自己设置,代码如下

var mySwiper= new Swiper(.swiper-container, {
       //这里的常规的设置参数
        pagination: .swiper-pagination,
        slidesPerView: 5,
        paginationClickable: true,
        spaceBetween: 30,
        loop:true,
        autoplay:1000,
        loopedSlides:5
    });
    $(.swiper-container).mouseover(function(){
        mySwiper.stopAutoplay();
    })
    $(.swiper-container).mouseout(function(){
        mySwiper.startAutoplay();
    })

注意事项:名称一定要一致,至于事件加到谁身上,自己决定。

 

文章来自:http://www.cnblogs.com/haley168/p/swiperAPI.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3