master
Lee 2021-12-28 13:09:11 +08:00
parent d26c4102c1
commit eaf9dde11b
1 changed files with 214 additions and 194 deletions

View File

@ -6,85 +6,85 @@ jQuery(function($){
delay:3000, delay:3000,
disableOnInteraction: false,//触摸后不会停止自动滚动 disableOnInteraction: false,//触摸后不会停止自动滚动
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。 pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
}, },
pagination: { pagination: {
el: '.banner-swiper .swiper-pagination', el: '.banner-swiper .swiper-pagination',
type: 'fraction', type: 'fraction',
formatFractionTotal: function (number) { formatFractionTotal: function (number) {
switch(number) switch(number)
{ {
case 1: case 1:
myNum='01' myNum='01'
break; break;
case 2: case 2:
myNum='02' myNum='02'
break; break;
case 3: case 3:
myNum='03' myNum='03'
break; break;
case 4: case 4:
myNum='04' myNum='04'
break; break;
case 5: case 5:
myNum='05' myNum='05'
break; break;
case 6: case 6:
myNum='06' myNum='06'
break; break;
case 7: case 7:
myNum='07' myNum='07'
break; break;
case 8: case 8:
myNum='08' myNum='08'
break; break;
case 9: case 9:
myNum='09' myNum='09'
break; break;
default:myNum= number default:myNum= number
} }
return myNum; return myNum;
}, },
formatFractionCurrent: function (number) { formatFractionCurrent: function (number) {
switch(number) switch(number)
{ {
case 1: case 1:
myNum='01' myNum='01'
break; break;
case 2: case 2:
myNum='02' myNum='02'
break; break;
case 3: case 3:
myNum='03' myNum='03'
break; break;
case 4: case 4:
myNum='04' myNum='04'
break; break;
case 5: case 5:
myNum='05' myNum='05'
break; break;
case 6: case 6:
myNum='06' myNum='06'
break; break;
case 7: case 7:
myNum='07' myNum='07'
break; break;
case 8: case 8:
myNum='08' myNum='08'
break; break;
case 9: case 9:
myNum='09' myNum='09'
break; break;
default:myNum= number default:myNum= number
} }
return myNum; return myNum;
}, },
renderFraction: function (currentClass, totalClass) { renderFraction: function (currentClass, totalClass) {
return '<span class="' + currentClass + '"></span>' + return '<span class="' + currentClass + '"></span>' +
' <em>/</em>' + ' <em>/</em>' +
'<span class="' + totalClass + '"></span>'; '<span class="' + totalClass + '"></span>';
}, },
}, },
effect : 'slide',//轮播的动效 默认为"slide"(普通位移切换),还可设置为"fade"(淡入)、"cube"(方块)、"coverflow"3d流、"flip"3d翻转、"cards"(卡片式)、"creative"(创意性)。 effect : 'slide',//轮播的动效 默认为"slide"(普通位移切换),还可设置为"fade"(淡入)、"cube"(方块)、"coverflow"3d流、"flip"3d翻转、"cards"(卡片式)、"creative"(创意性)。
// fadeEffect: { // fadeEffect: {
@ -100,120 +100,140 @@ jQuery(function($){
// this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次去除ani类名 // this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次去除ani类名
} }
} }
});
// 资质展示
if(screen.width <= 768){
var qualificationSwiper = new Swiper('.qualification-swiper',{
loop:false,//开启循环播放
autoplay: {//开启自动播放
delay:3000,
disableOnInteraction: false,//触摸后不会停止自动滚动
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
},
slidesPerView : '1',
spaceBetween : '0%',
centeredSlides : false,
navigation: {
nextEl: '.qualification-swiper-bg .swiper-button-prev',
prevEl: '.qualification-swiper-bg .swiper-button-next',
},
});
}else{
var qualificationSwiper = new Swiper('.qualification-swiper',{
loop:false,//开启循环播放
autoplay: {//开启自动播放
delay:3000,
disableOnInteraction: false,//触摸后不会停止自动滚动
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
},
slidesPerView : '4',
spaceBetween : '3%',
centeredSlides : false,
navigation: {
nextEl: '.qualification-swiper-bg .swiper-button-prev',
prevEl: '.qualification-swiper-bg .swiper-button-next',
},
});
}
// 改变头部背景透明度
if(screen.width > 900){
var spotTop = $("#spot").offset().top-90;
$(window).bind("scroll",function(){
var topScroll=$(this).scrollTop();//当前窗口的滚动距离
if(topScroll > spotTop){
$(".header").css("background-color","rgba(255,255,255,1)");
$(".header").css("box-shadow","0 0 10px 3px rgba(0,0,0,0.2)");
$(".header").css("transition","all .8s");
}else{
$(".header").css("background-color","rgba(255,255,255,0.75)");
$(".header").css("box-shadow","0 0 10px 3px rgba(0,0,0,0)");
$(".index-header").css("background-color","rgba(255,255,255,0)");
$(".index-header").css("box-shadow","0 0 10px 3px rgba(0,0,0,0)");
}
})
};
// 首页产品切换
$(".case-item li").eq(0).addClass("active");
$(".case-serve-all .case-serve").eq(0).addClass("active");
$(".case-list-all>div").eq(0).show();
$(".case-list-01 .case-list").eq(0).show();
$(".case-list-02 .case-list").eq(0).show();
$(".case-list-03 .case-list").eq(0).show();
$(".case-list-04 .case-list").eq(0).show();
$(".case-item li").hover(function() {
$(".case-item li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".case-serve-all .case-serve").removeClass('active').eq($(this).index()).addClass("active");
$(".case-list-all>div").hide().eq($(this).index()).show();
});
$(".case-serve li").click(function() {
$(".case-serve li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".case-list-01 .case-list").hide().eq($(this).index()).show();
$(".case-list-02 .case-list").hide().eq($(this).index()).show();
$(".case-list-03 .case-list").hide().eq($(this).index()).show();
$(".case-list-04 .case-list").hide().eq($(this).index()).show();
});
// 案例列表产品展示
$(".case-item-bs li").eq(0).addClass("active");
$(".case-serve-all-bs .case-serve-bs").eq(0).addClass("active");
$(".case-item-bs li").click(function() {
$(".case-item-bs li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".case-serve-all-bs .case-serve-bs").removeClass('active').eq($(this).index()).addClass("active");
});
// 评估&预约切换
$(".estimate-item>li").eq(0).addClass("active");
$(".estimate-list>li").eq(0).show();
$(".estimate-item>li").click(function() {
$(".estimate-item>li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".estimate-list>li").hide().eq($(this).index()).show();
});
// 改变选中状态
$(".estimate-01 li").click(function() {
$(".estimate-01 li").find("input").attr("checked",false);
$(this).find("input").attr("checked",true);
});
$(".estimate-02 li").click(function() {
$(".estimate-02 li").find("input").attr("checked",false);
$(this).find("input").attr("checked",true);
});
// 服务
$(".serve-nav li").click(function() {
$(".serve-nav li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".serve-content .left .pull-txt").hide().eq($(this).index()).show();
});
// 友情链接
$(".links-item li").hover(function() {
$(".links-item li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".links-list li").hide().eq($(this).index()).show();
});
// 手机导航按钮
$('.head .head-btn').click(function() {
if ($('.head .head-btn').attr('class') == 'head-btn cur') {
$('.head .head-btn').removeClass('cur');
$('.head .nav').removeClass('active');
$('.head .nav-bg').removeClass('active');
} else {
$('.head .head-btn').addClass('cur');
$('.head .nav').addClass('active');
$('.head .nav-bg').addClass('active');
$('.head .logo').addClass('active');
}
});
$('.head .nav-bg').click(function() {
$(this).removeClass('active');
$('.head .head-btn').removeClass('cur');
$('.head .nav').removeClass('active');
}); });
})
// 资质展示
if(screen.width <= 768){
var qualificationSwiper = new Swiper('.qualification-swiper',{
loop:false,//开启循环播放
autoplay: {//开启自动播放
delay:3000,
disableOnInteraction: false,//触摸后不会停止自动滚动
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
},
slidesPerView : '1',
spaceBetween : '0%',
centeredSlides : false,
navigation: {
nextEl: '.qualification-swiper-bg .swiper-button-prev',
prevEl: '.qualification-swiper-bg .swiper-button-next',
},
});
}else{
var qualificationSwiper = new Swiper('.qualification-swiper',{
loop:false,//开启循环播放
autoplay: {//开启自动播放
delay:3000,
disableOnInteraction: false,//触摸后不会停止自动滚动
pauseOnMouseEnter: true,//鼠标置于swiper时暂停自动切换鼠标离开时恢复自动切换。
},
slidesPerView : '4',
spaceBetween : '3%',
centeredSlides : false,
navigation: {
nextEl: '.qualification-swiper-bg .swiper-button-prev',
prevEl: '.qualification-swiper-bg .swiper-button-next',
},
});
}
// 改变头部背景透明度
if(screen.width > 900){
var spotTop = $("#spot").offset().top-90;
$(window).bind("scroll",function(){
var topScroll=$(this).scrollTop();//当前窗口的滚动距离
if(topScroll > spotTop){
$(".header").css("background-color","rgba(255,255,255,1)");
$(".header").css("box-shadow","0 0 10px 3px rgba(0,0,0,0.2)");
$(".header").css("transition","all .8s");
}else{
$(".header").css("background-color","rgba(255,255,255,0.75)");
$(".header").css("box-shadow","0 0 10px 3px rgba(0,0,0,0)");
$(".index-header").css("background-color","rgba(255,255,255,0)");
$(".index-header").css("box-shadow","0 0 10px 3px rgba(0,0,0,0)");
}
})
};
// 首页产品切换
$(".case-item li").eq(0).addClass("active");
$(".case-serve-all .case-serve").eq(0).addClass("active");
$(".case-list-all>div").eq(0).show();
$(".case-item li").hover(function() {
$(".case-item li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".case-serve-all .case-serve").removeClass('active').eq($(this).index()).addClass("active");
$(".case-list-all>div").hide().eq($(this).index()).show();
});
// 评估&预约切换
$(".estimate-item>li").eq(0).addClass("active");
$(".estimate-list>li").eq(0).show();
$(".estimate-item>li").click(function() {
$(".estimate-item>li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".estimate-list>li").hide().eq($(this).index()).show();
});
// 改变选中状态
$(".estimate-01 li").click(function() {
$(".estimate-01 li").find("input").attr("checked",false);
$(this).find("input").attr("checked",true);
});
$(".estimate-02 li").click(function() {
$(".estimate-02 li").find("input").attr("checked",false);
$(this).find("input").attr("checked",true);
});
// 服务
$(".serve-nav li").click(function() {
$(".serve-nav li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".serve-content .left .pull-txt").hide().eq($(this).index()).show();
});
// 友情链接
$(".links-item li").hover(function() {
$(".links-item li").eq($(this).index()).addClass("active").siblings().removeClass('active');
$(".links-list li").hide().eq($(this).index()).show();
});
// 手机导航按钮
$('.head .head-btn').click(function() {
if ($('.head .head-btn').attr('class') == 'head-btn cur') {
$('.head .head-btn').removeClass('cur');
$('.head .nav').removeClass('active');
$('.head .nav-bg').removeClass('active');
} else {
$('.head .head-btn').addClass('cur');
$('.head .nav').addClass('active');
$('.head .nav-bg').addClass('active');
$('.head .logo').addClass('active');
}
});
$('.head .nav-bg').click(function() {
$(this).removeClass('active');
$('.head .head-btn').removeClass('cur');
$('.head .nav').removeClass('active');
});
})