swipper轮播左右点击事件
function initSwiper(){
// 轮播
var Swiper_banner = new Swiper('#swiper_banner', {
speed:300,
autoplay : {
delay:5000,
disableOnInteraction:false,
},
// navigation:{
// prevButton: '.swiper-button-prev',
// nextButton: '.swiper-button-next',
// },
prevButton: '.swiper-button-prev',
nextButton: '.swiper-button-next',
// loop : true,
observer:true,//修改swiper自己或子元素时,自动初始化swiper 重要
observeParents:true,//修改swiper的父元素时,自动初始化swiper 重要
pagination: {
el: '.swiper-pagination',
clickable :true,
},
})
$('.swiper-button-prev').click(function(){
Swiper_banner.slidePrev();
// mySwiper.autoplay.start();
})
$('.swiper-button-next').click(function(){
Swiper_banner.slideNext();
// $(".page-nums-switch").text(switchNum);
// mySwiper.autoplay.start();
})
}