前端文档

swiper定位到index

日期:2017-08-07 阅读:686

dmandwp系统 - wordpress系统和DM系统区块建站>>

参考:https://stackoverflow.com/questions/23922480/go-to-a-specific-slide-with-idangerous-swiper

 //----mobile swiper-----------
         var swiper3 = new Swiper('.landswipermob', {
        //pagination: '.swiper-pagination',
       // paginationClickable: true,
        nextButton: '#swiper-button-nextmob',
        prevButton: '#swiper-button-prevmob',
        loop: true,
        pagination : '#swiper-paginationmob',
        paginationClickable :true,
        slideToClickedSlide:true,  // ---要加这个
        spaceBetween: 30

// initialSlide: 0, //slide number which you want to show-- 0 by default
    });
    
    
 swiper3.slideTo(2,1000,false ); 、、----用这个slideTo方法

 

<<点击返回