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);
})