上传文件至 'js'

master
Lee 2022-01-27 14:52:13 +08:00
parent 026b6b72c5
commit 8b163c462e
1 changed files with 31 additions and 27 deletions

View File

@ -1,31 +1,35 @@
jQuery(function($){ jQuery(function($){
// banner轮播 // banner轮播
var bannerSwiper = new Swiper('.banner-swiper',{ var number = $('.banner-swiper .swiper-slide').length-2;
loop:true,//开启循环播放 if(number>1){
autoplay: {//开启自动播放 var bannerSwiper = new Swiper('.banner-swiper',{
delay:3000, loop:true,//开启循环播放
disableOnInteraction: false,//触摸后不会停止自动滚动 autoplay: {//开启自动播放
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。 delay:3000,
}, disableOnInteraction: false,//触摸后不会停止自动滚动
pagination: { pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
el: '.banner-swiper .swiper-pagination',
clickable :true,
},
effect : 'slide',//轮播的动效 默认为"slide"(普通位移切换),还可设置为"fade"(淡入)、"cube"(方块)、"coverflow"3d流、"flip"3d翻转、"cards"(卡片式)、"creative"(创意性)。
// fadeEffect: {
// crossFade: true,
// },
on:{
init: function(){
swiperAnimateCache(this); //隐藏动画元素
swiperAnimate(this); //初始化完成开始动画
}, },
slideChangeTransitionEnd: function(){ pagination: {
swiperAnimate(this); //每个slide切换结束时也运行当前slide动画 el: '.banner-swiper .swiper-pagination',
// this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次去除ani类名 clickable :true,
},
effect : 'slide',//轮播的动效 默认为"slide"(普通位移切换),还可设置为"fade"(淡入)、"cube"(方块)、"coverflow"3d流、"flip"3d翻转、"cards"(卡片式)、"creative"(创意性)。
// fadeEffect: {
// crossFade: true,
// },
on:{
init: function(){
swiperAnimateCache(this); //隐藏动画元素
swiperAnimate(this); //初始化完成开始动画
},
slideChangeTransitionEnd: function(){
swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
// this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次去除ani类名
}
} }
} });
}); }
// 数据产品切换 // 数据产品切换
$(".product-list li").eq(0).addClass("cur"); $(".product-list li").eq(0).addClass("cur");