轮播 swiper

 // 轮播 banner  单张图片滚动
            var mySwiper = new Swiper('.swiper-container',{
                pagination: '.pagination',
                grabCursor: true,
                paginationClickable: true,
//              autoplay : 3000,//可选选项,自动滑动
                loop : true,//可选选项,开启循环
            });
            
              // 轮播  多张图片滚动
            var mySwiper2 = new Swiper('.swiper-container2',{
            	prevButton: '.swiper-button-prev',
        		nextButton: '.swiper-button-next',
            	slidesPerView : 5,
				centeredSlides : true,
                loop : true,//可选选项,开启循环
//              autoplay : 2000,//可选选项,自动滑动
			    grabCursor: true,
			    paginationClickable: true
            });
            $('.arrow-left').on('click', function(e){
			    e.preventDefault()
			    mySwiper2.swipePrev();
			  });
			  $('.arrow-right').on('click', function(e){
			    e.preventDefault()
			    mySwiper2.swipeNext();
			  });

猜你喜欢

转载自blog.csdn.net/lianxin19900610/article/details/82217340