• swiper保存


    //初始化swiper
    var index=0;
    if(sessionStorage.getItem("index")){
    index=sessionStorage.getItem("index");
    }
    var swiper = new Swiper('.swiper-container', {
    nextButton: '.swiper-button-next',
    prevButton: '.swiper-button-prev',
    initialSlide: index,//设定初始化时slide的索引
    centeredSlides: true
    });
    //点击页面链接跳转前保存导航当前的index值
    $("a").bind("click",function(){
    var i= $(".swiper-slide-active").index();
    sessionStorage.setItem("index",i);
    })

  • 相关阅读:
    bzoj1648
    bzoj3404
    bzoj1650
    bzoj1625
    bzoj1606
    bzoj1464
    bzoj1572
    bzoj1617
    bzoj1092
    bzoj1091
  • 原文地址:https://www.cnblogs.com/huancheng/p/7357743.html
Copyright © 2020-2023  润新知