master
Lee 2021-12-15 09:11:22 +08:00
parent 4e9d2ad6ae
commit 587c04b173
1 changed files with 92 additions and 82 deletions

View File

@ -30,86 +30,96 @@ jQuery(function($){
// this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次去除ani类名
}
}
});
// 锚点效果
$('.memorabili-btn').click(function(){$('html,body').animate({scrollTop:$('#memorabili').offset().top}, 1000);});
$('.culture-btn').click(function(){$('html,body').animate({scrollTop:$('#culture').offset().top}, 800);});
$('.about-btn').click(function(){$('html,body').animate({scrollTop:$('#about').offset().top}, 600);});
// 大事记滚动
if(screen.width <= 768){
var memorabiliSwiper = new Swiper('.memorabili-swiper',{
loop:false,//开启循环播放
autoplay : {
delay:3000,
disableOnInteraction: false,
},
effect : 'fade',
fadeEffect: {
crossFade: true,
},
navigation: {
nextEl: '.memorabili-swiper .swiper-button-prev',
prevEl: '.memorabili-swiper .swiper-button-next',
},
})
}else{
var memorabiliSwiper = new Swiper('.memorabili-swiper',{
loop:false,//开启循环播放
autoplay: false,
slidesPerView : '4',
centeredSlides : false,
navigation: {
nextEl: '.memorabili-swiper .swiper-button-prev',
prevEl: '.memorabili-swiper .swiper-button-next',
},
})
}
// 人才招聘切换
$(".join-list li").click(function() {
$(".join-list li").eq($(this).index()).toggleClass("active").siblings().removeClass('active');
});
// 产品图片切换
var productSwiper = new Swiper('.product-swiper',{
loop:true,//开启循环播放
speed: 1000,
autoplay: {//开启自动播放
delay:3000,
disableOnInteraction: false,//触摸后不会停止自动滚动
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
},
effect : 'fade',
fadeEffect: {
crossFade: true,
},
pagination: {//分页器
el: '.product-swiper .swiper-pagination',
type: 'bullets',
},
navigation: { //翻页
nextEl: '.product-swiper .swiper-button-next',
prevEl: '.product-swiper .swiper-button-prev',
},
});
// 手机导航按钮
$('.header-content .head-btn').click(function() {
if ($('.header-content .head-btn').attr('class') == 'head-btn cur') {
$('.header-content .head-btn').removeClass('cur');
$('.header-content .nav').removeClass('active');
} else {
$('.header-content .head-btn').addClass('cur');
$('.header-content .nav').addClass('active');
}
});
$(".top-nav li").click(function(){
});
// 首页产品切换
$(".product-items li").eq(0).addClass("active");
$(".product-classify li").click(function() {
$(".product-classify li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".product-items li").removeClass('active').eq($(this).index()).addClass("active");
});
// 锚点效果
$('.memorabili-btn').click(function(){$('html,body').animate({scrollTop:$('#memorabili').offset().top}, 1000);});
$('.culture-btn').click(function(){$('html,body').animate({scrollTop:$('#culture').offset().top}, 800);});
$('.about-btn').click(function(){$('html,body').animate({scrollTop:$('#about').offset().top}, 600);});
// 大事记滚动
if(screen.width <= 768){
var memorabiliSwiper = new Swiper('.memorabili-swiper',{
loop:false,//开启循环播放
autoplay : {
delay:3000,
disableOnInteraction: false,
},
effect : 'fade',
fadeEffect: {
crossFade: true,
},
navigation: {
nextEl: '.memorabili-swiper .swiper-button-prev',
prevEl: '.memorabili-swiper .swiper-button-next',
},
})
}else{
var memorabiliSwiper = new Swiper('.memorabili-swiper',{
loop:false,//开启循环播放
autoplay: false,
slidesPerView : '4',
centeredSlides : false,
navigation: {
nextEl: '.memorabili-swiper .swiper-button-prev',
prevEl: '.memorabili-swiper .swiper-button-next',
},
})
}
// 人才招聘切换
$(".join-list li").click(function() {
$(".join-list li").eq($(this).index()).toggleClass("active").siblings().removeClass('active');
});
// 产品图片切换
var productSwiper = new Swiper('.product-swiper',{
loop:true,//开启循环播放
speed: 1000,
autoplay: {//开启自动播放
delay:3000,
disableOnInteraction: false,//触摸后不会停止自动滚动
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
},
effect : 'fade',
fadeEffect: {
crossFade: true,
},
pagination: {//分页器
el: '.product-swiper .swiper-pagination',
type: 'bullets',
},
navigation: { //翻页
nextEl: '.product-swiper .swiper-button-next',
prevEl: '.product-swiper .swiper-button-prev',
},
});
// 手机导航按钮
$('.header-content .head-btn').click(function() {
if ($('.header-content .head-btn').attr('class') == 'head-btn cur') {
$('.header-content .head-btn').removeClass('cur');
$('.header-content .nav').removeClass('active');
} else {
$('.header-content .head-btn').addClass('cur');
$('.header-content .nav').addClass('active');
}
});
$(".top-nav li").click(function(){
})
})
})