$(function () {
if($(".service-part01 dl dd").length>0){
$(".counter").countup();
}
if($(".company-par01 .ll").length>0){
$(".counter").countup();
}
if($(".about-par01 ul").length>0){
$(".counter").countup();
}
if($(".operations-part01 .info").length>0){
$(".counter").countup();
}
$('.dynamics-par01 li dl a').each(function(){
if ($(this).attr('href') == 'javascript:void(0);') {
$(this).css("cursor","default");
}
});
wowdelay(".dynamics-par01 ul",$('.dynamics-par01 ul li').length,"0.2");
if($(window).width()<768){
scolltext(".about-par02 li dd .inner");
}
scolltext(".about-par01 .con .inner");
party02();
party03();
history();
aboutp01();
aboutp04();
operationsp06();
servicep02();
})
function party02(){
if($(window).width()>=1024){
if($(".party02-ll").length>0){
var party02llswiper = new swiper('.party02-ll .swiper-container', {
autoplay: 5000,
slidesperview:1,
effect : 'fade',
prevbutton:'.party02-ll .swiper-button-prev',
nextbutton:'.party02-ll .swiper-button-next',
onslidechangestart: function() {
updatenavposition_party()
}
})
$('.party02-ll .swiper-button-prev,.party02-rr .swiper-button-prev').on('click', function(e) {
e.preventdefault()
if (party02llswiper.activeindex == 0) {
party02llswiper.slideto(party02llswiper.slides.length - 1, 1000);
return
}
party02llswiper.slideprev()
})
$('.party02-ll .swiper-button-next,.party02-rr .swiper-button-next').on('click', function(e) {
e.preventdefault()
if (party02llswiper.activeindex == party02llswiper.slides.length - 1) {
party02llswiper.slideto(0, 1000);
return
}
party02llswiper.slidenext()
})
var party02rrswiper = new swiper('.party02-rr .swiper-container', {
autoplay: 3000,
slidesperview :4,
direction : 'vertical',
spacebetween: 0,
allowtouchmove: false,
ontap: function() {
party02llswiper.slideto(party02rrswiper.clickedindex)
}
})
function updatenavposition_party() {
$('.party02-rr .on').removeclass('on')
var activenav = $('.party02-rr .swiper-slide').eq(party02llswiper.activeindex).addclass('on')
if (!activenav.hasclass('swiper-slide-visible')) {
if (activenav.index() > party02rrswiper.activeindex) {
var thumbspernav = math.floor(party02rrswiper.height / activenav.height()) - 1
party02rrswiper.slideto(activenav.index() - thumbspernav)
} else {
party02rrswiper.slideto(activenav.index())
}
}
}
$('.party02-rr .swiper-slide').hover(function() {
$('.party02-rr .swiper-slide').removeclass('on');
$(this).addclass('on');
party02llswiper.slideto($(this).index());
})
}
}
else{
if($(".party02-ll").length>0){
var party02llswiper = new swiper('.party02-ll .swiper-container', {
autoplay: 5000,
slidesperview:1,
prevbutton:'.party02-ll .swiper-button-prev',
nextbutton:'.party02-ll .swiper-button-next',
})
}
}
}
function party03(){
if($(".party-par03 .box .swiper-container").length>0){
var part03_swiper = new swiper('.party-par03 .box .swiper-container', {
nextbutton: '.party-par03 .box .swiper-button-next',
prevbutton: '.party-par03 .box .swiper-button-prev',
slidesperview: 4,
spacebetween : 20,
breakpoints: {
1023: {
slidesperview: 2,
},
767: {
slidesperview: 1,
}
}
});
}
$('.party-par03 .box a').each(function(){
if ($(this).attr('href') == 'javascript:void(0);') {
$(this).css("cursor","default")
}
});
}
function history(){
//悬浮
if($(".yearbox").length>0){
$anchortop=$('.yearbox').offset().top;
$(window).scroll(function(){
wint=$(window).scrolltop();
$anchor=$('.yearbox');
if (wint>$anchortop) {
$('body').addclass('yearbox_fixed');
}
else{
$('body').removeclass('yearbox_fixed');
}
})
}
//下拉
$(document).on("click", ".yearbox dt", function (e) {
e.preventdefault();
e.stoppropagation();
var el = $(this).parents(".yearbox");
if(el.hasclass('open')){
el.removeclass('open');
el.find("dd").stop().slideup();
}else{
el.addclass('open');
el.find("dd").stop().slidedown();
}
})
$(document).click(function () {
$(".yearbox.open").removeclass("open");
$(".yearbox").find("dd").stop().slideup();
})
//锚点
$(document).on("click", ".yearbox dd p[link]", function(e) {
e.preventdefault();
e.stoppropagation();
$(".yearbox dd").find('p').removeclass('active');
$(this).addclass('active');
var ii =$(this).index();
$(".hisbox li").eq(ii).addclass("on").siblings().removeclass("on");
var id = $(this).attr("link");
var toph = $(".yearbox").height();
var headh = $("header").height()
//var divh = $("#" + id).offset().top - toph - headh
var divh = $("#" + id).offset().top - toph - headh
$('html,body').animate({
scrolltop : divh
}, 500);
})
}
function aboutp01(){
var bsrcl="",bsimg='';
$(document).on("click",".about_video",function(e){
bsrcl=$(this).data("video");
bsimg=$(this).data("img");
$(".video_appbox").addclass("show")
video();
})
$(document).on("click",".video_close",function(){
$(this).parent(".video_appbox").removeclass("show")
$(".video_t").html("")
});
$(document).on("click",".video_appbox .mask",function(){
$(this).parent(".video_appbox").removeclass("show")
$(".video_t").html("")
})
function video(){
$(".video_t").html("")
$(".video_t video").attr({width:$(".video_t").width(),height:$(".video_t").height()})
}
}
function aboutp04(){
if($(window).width()>=768){
if($(".about-par04 .swbox .swiper-container").length>0){
var aboutp04_swiper = new swiper('.about-par04 .swbox .swiper-container', {
nextbutton: '.about-par04 .swbox .swiper-button-next',
prevbutton: '.about-par04 .swbox .swiper-button-prev',
slidesperview: 4,
spacebetween : 58,
breakpoints: {
1023: {
slidesperview: 2,
spacebetween : 30,
},
767: {
slidesperview: 1,
spacebetween : 10,
}
}
});
}
}else{
$(".about-par04 .swbox .swiper-button-prev,.about-par04 .swbox .swiper-button-next").hide();
}
}
function operationsp06(){
if($(".operations-part06 .view").length>0){
var viewswiper = new swiper('.view .swiper-container', {
autoplay: 3000,
effect : 'fade',
prevbutton:'.view .swiper-button-prev',
nextbutton:'.view .swiper-button-next',
onslidechangestart: function() {
updatenavposition()
}
})
$('.view .swiper-button-prev,.preview .swiper-button-prev').on('click', function(e) {
e.preventdefault()
if (viewswiper.activeindex == 0) {
viewswiper.slideto(viewswiper.slides.length - 1, 1000);
return
}
viewswiper.slideprev()
})
$('.view .swiper-button-next,.preview .swiper-button-next').on('click', function(e) {
e.preventdefault()
if (viewswiper.activeindex == viewswiper.slides.length - 1) {
viewswiper.slideto(0, 1000);
return
}
viewswiper.slidenext()
})
var previewswiper = new swiper('.preview .swiper-container', {
autoplay: 3000,
slidesperview : 6,
spacebetween: 20,
allowtouchmove: false,
ontap: function() {
viewswiper.slideto(previewswiper.clickedindex)
},
breakpoints: {
1023:{
slidesperview : 4,
},
767:{
slidesperview : 2,
spacebetween: 0,
}
}
})
function updatenavposition() {
$('.preview .on').removeclass('on')
var activenav = $('.preview .swiper-slide').eq(viewswiper.activeindex).addclass('on')
if (!activenav.hasclass('swiper-slide-visible')) {
if (activenav.index() > previewswiper.activeindex) {
var thumbspernav = math.floor(previewswiper.width / activenav.width()) - 1
previewswiper.slideto(activenav.index() - thumbspernav)
} else {
previewswiper.slideto(activenav.index())
}
}
}
$('.preview .swiper-slide').hover(function() {
$('.preview .swiper-slide').removeclass('on');
$(this).addclass('on');
viewswiper.slideto($(this).index());
})
}
}
function servicep02(){
if($(window).width()<=767){
$('.service-par02 .bimg li').each(function (){
if($(this).find("p").height()>44){
$(this).find("em").show();
}
else{
$(this).find("em").hide();
}
$(this).find("em").click(function (){
$(this).parents(".txt").toggleclass("active")
})
})
}
else if($(window).width()>1023){
$('.scon li').hover(function (){
var ii =$(this).index();
$(this).addclass("on").siblings().removeclass("on");
$('.bimg .swiper-slide').eq(ii).addclass("on").siblings().removeclass("on");
})
}
else if(767<$(window).width()<=1023){
if($(".bimg .swiper-container").length>0){
var bimgswiper = new swiper('.bimg .swiper-container', {
prevbutton:'.bimg .swiper-button-prev',
nextbutton:'.bimg .swiper-button-next',
})
}
}
}
function wowdelay(box,row,delaytime){
$(box).children().each(function(index){
for(var i = 0;i0){
$(obj).mcustomscrollbar({
mousewheelpixels:500,
autodraggerlength:false,
advanced: {
autoscrollonfocus: ""
}
});
}
}
//产品分级 一店一策差异打造
$(function () {
if($(window).width()<=1023){
if($(".imgshow .swiper-container").length>0){
var imgshowswiper = new swiper('.imgshow .swiper-container', {
pagination: '.imgshow .swiper-pagination',
paginationclickable :true,
})
}
}
else{
$('.imgshow li').hover(function () {
$(this).addclass('active').siblings().removeclass('active');
}, function () {
})
delayplay('.imgshow li', 0.2)
}
if($(window).width()<=767){
$('.imgshow li').each(function (){
$(this).find("em").click(function (){
$(this).parents(".hide").toggleclass("active")
})
})
}
})
function delayplay(el, time) {
$(el).each(function (index, item) {
$(item).attr('data-wow-delay', time * index + 's');
})
}
//产品分级 一店一策差异打造end