2022-01-23 13:24:41 +08:00
|
|
|
|
jQuery(function($){
|
|
|
|
|
// banner轮播
|
|
|
|
|
var bannerSwiper = new Swiper('.banner-swiper',{
|
|
|
|
|
loop:true,//开启循环播放
|
|
|
|
|
autoplay: {//开启自动播放
|
|
|
|
|
delay:3000,
|
|
|
|
|
disableOnInteraction: false,//触摸后不会停止自动滚动
|
|
|
|
|
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换,鼠标离开时恢复自动切换。
|
|
|
|
|
},
|
|
|
|
|
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-item li').hover(function() {
|
|
|
|
|
$(".product-item li").eq($(this).index()).addClass("active").siblings().removeClass('active');
|
|
|
|
|
$(".product-list li").eq($(this).index()).addClass("cur").siblings().removeClass('cur');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 回到顶部
|
|
|
|
|
$('.toTop').click(function(){$('html,body').animate({scrollTop:$('#top').offset().top}, 1000);});
|
|
|
|
|
});
|