$(function () {
windowwidth();
$(window).resize(function () {
windowwidth();
});
var backtop = $("a.zdsbacktop");
var wint = $(window).scrolltop();
$(window).on('scroll', function () {
wint = $(window).scrolltop();
if (wint <= 400) {
backtop.fadeout(300);
};
if (wint > 400) {
backtop.fadein(300);
};
});
backtop.on('click', function () {
$("html,body").stop(false, true).animate({ "scrolltop": 0 }, 500);
return false;
});
$(".pro-datial-tab table").wrap("
");
$(".inxnews-list li").eq(0).addclass("fadeinleft");
$(".inxnews-list li").eq(1).addclass("fadeinleft");
$(".inxnews-list li").eq(2).addclass("fadeinright");
$(".inxnews-list li").eq(3).addclass("fadeinright");
$(".indxarrivals li").eq(0).addclass("fadeinright");
$(".indxarrivals li").eq(1).addclass("fadeinup");
$(".indxarrivals li").eq(2).addclass("fadeinleft");
$(".inxsolut-wrapper li").eq(0).addclass("fadeinleft");
$(".inxsolut-wrapper li").eq(1).addclass("fadeinleft");
$(".inxsolut-wrapper li").eq(2).addclass("fadeinright");
$(".inxsolut-wrapper li").eq(3).addclass("fadeinright");
$(document).on('click', function (ev) {
if ($(window).width() > 1023) {
}
if ($(window).width() < 1024) {
if (!$(ev.target).closest('.full-inside-subnav').length) {
$('.inside-subnav .subnav').stop().slideup();
}
if (!$(ev.target).closest('.third-cate').length) {
$('.third-cate .cate-list').stop().slideup();
}
}
if (!$(ev.target).closest('.headcompany').length) {
$('.company-choose').stop().hide();
}
});
if($(".yline").length > 0){
$('.yline').countto({
lastsymbol:"", //显示在最后的字符
from: 0, // 开始时的数字
speed: 1500, // 总时间
refreshinterval:100, // 刷新一次的时间
beforesize:0, //小数点前最小显示位数,不足的话用0代替
decimals: 0 // 小数点后的位数,小数做四舍五入
});
}
if($(".pro-screening").length>0){
$(".pro-screening").citys({
provice: ".a",
city: ".b",
defaul: ".defaultvalue"
});
}
// 副导航栏
$('.third-chl').on('click', function () {
$(this).next().stop().slidetoggle();
});
$(".channel-title").click(function () {
if ($(this).hasclass("cur")) {
$(".full-inside-subnav .subnav").stop().slideup(300, function () {
$(this).removeattr("style");
});
$(this).removeclass("cur");
}
else {
$(".full-inside-subnav .subnav").stop().slidedown(300);
$(this).addclass("cur");
}
});
var clumbwid = 0;
var clumbalength = $(".common-clumb a").length;
$(".common-clumb a").each(function () {
var thisele = $(this);
clumbwid += thisele.outerwidth();
});
if (clumbwid > $(".common-clumb").width()) {
$(".common-clumb-box").append('')
if ($(window).width() > 1023) {
$(".common-clumb-box").css({ "padding": "0 40px" });
}
var swiper = new swiper('.common-clumb', {
pagination: '',
paginationclickable: true,
roundlengths: true,
slidesperview: "auto",
spacebetween: 0,
nextbutton: '.sub-next',
prevbutton: '.sub-prev',
preventlinkspropagation: false
});
swiper.slideto($(".common-clumb a.cur").index(), 0, false);
}
if(typeof swiper != 'undefined') {
var relatswiper = new swiper(".solwrapper-min", {
slidesperview: 4,
simulatetouch: false,
speed: 1200,
spacebetween: 30,
nextbutton:'.relat-solute-wrapper .relat-next',
prevbutton:'.relat-solute-wrapper .relat-prev',
breakpoints: {
414: {
spacebetween: 0,
slidesperview: 2
}
}
});
var caseswiper = new swiper(".caeslwrapper-min", {
slidesperview: 3,
simulatetouch: false,
speed: 1200,
spacebetween: 30,
nextbutton:'.relat-case-wrapper .relat-next',
prevbutton:'.relat-case-wrapper .relat-prev',
breakpoints: {
414: {
slidesperview: 1
}
}
});
var proswiper = new swiper(".soproduct-min", {
slidesperview: 4,
simulatetouch: false,
speed: 1200,
spacebetween: 30,
nextbutton:'.relat-product-wrapper .relat-next',
prevbutton:'.relat-product-wrapper .relat-prev',
breakpoints: {
414: {
spacebetween: 10,
slidesperview: 2
}
}
});
// 职业发展
var careerswiper = new swiper(".wrapper-min", {
slidesperview: 3,
simulatetouch: false,
speed: 1200,
spacebetween: 30,
nextbutton:'.career-wrapper .relat-next',
prevbutton:'.career-wrapper .relat-prev',
breakpoints: {
414: {
slidesperview: 1
}
}
});
// 发展历程
var historyswiper = new swiper('.historyulitem', {
slidesperview: 4,
nextbutton: '.hisswiper-right',
prevbutton: '.hisswiper-left',
paginationclickable: true,
spacebetween: 0,
slidespergroup: 1,
breakpoints: {
991: {
slidesperview: 3,
},
414: {
spacebetween: 0,
slidesperview: 1
}
}
});
var inxnewswiper = new swiper('.inxnews-list', {
slidesperview: 4,
spacebetween: 30,
nextbutton: '.indxnews-wraper .index-next',
prevbutton: '.indxnews-wraper .index-prev',
paginationclickable: true,
breakpoints: {
768: {
slidesperview: 3,
spacebetween: 20
},
414: {
spacebetween: 10,
slidesperview: 1
}
}
});
var arrswiper = new swiper(".arrivalsp-min", {
slidesperview: 3,
simulatetouch: false,
speed: 1200,
spacebetween: 30,
nextbutton:'.arrivals-wrapper .index-next',
prevbutton:'.arrivals-wrapper .index-prev',
breakpoints: {
768: {
spacebetween: 20
},
414: {
slidesperview: 1
}
}
});
var inxsolutswiper = new swiper(".inxsolut-min", {
slidesperview: 4,
simulatetouch: false,
speed: 1200,
spacebetween: 30,
pagination: '.inxsolut-wrapper .ipages',
nextbutton:'.inxsolut-wrapper .index-next',
prevbutton:'.inxsolut-wrapper .index-prev',
breakpoints: {
768: {
slidesperview: 3,
spacebetween: 20,
},
414: {
slidesperview: 1
}
}
});
var inxpartswiper = new swiper(".partner-wrapper", {
slidesperview: 5,
simulatetouch: false,
speed: 1200,
spacebetween: 25,
nextbutton:'.inxpart-list .index-next',
prevbutton:'.inxpart-list .index-prev',
breakpoints: {
768: {
slidesperview: 3,
spacebetween: 20,
},
414: {
spacebetween: 10,
slidesperview: 2
}
}
});
var prodatswiper = new swiper('.minimg-wrapper', {
effect: 'slide',
loop: true,
autoplay: 4000,
speed: 1200,
pagination: '.minimg-wrapper .ipages',
paginationclickable: true,
nextbutton: '.prodatile-next',
prevbutton: '.prodatile-prev',
preventclicks: false,
autoplaydisableoninteraction: false,
// simulatetouch: false,
grabcursor: false,
parallax: true
});
// banner
$(".indexbanner ul li").addclass("active");
if ($(".indexbanner li").length > 1) {
var indexswiper = new swiper('.indexbanner', {
effect: 'slide',
loop: true,
autoplay: 4000,
speed: 1200,
pagination: '.indexbanner .ipages',
paginationclickable: true,
preventclicks: false,
autoplaydisableoninteraction: false,
// simulatetouch: false,
grabcursor: false,
parallax: true,
ontransitionend: function ontransitionend(swiper) {
$(".indexbanner ul li").eq(swiper.activeindex).addclass("active").siblings().removeclass("active");
}
});
}
$('.indexbanner').mouseover(function () {
indexswiper.stopautoplay();
});
$('.indexbanner').mouseout(function () {
indexswiper.startautoplay();
});
}
$(".tab-options a").click(function () {
var t = $(".tab-options a").index($(this));
$(".tab-options a").removeclass("cur").eq(t).addclass("cur");
$("html,body").animate({scrolltop: $(".composimin").eq(t).offset().top - 80}, {duration: 500,easing: "swing"});
});
// if($('.tab-options').length>0) {
// $(document).ready(function (e) {
// t = $('.tab-options').offset().top - 80;
// // fh = $('.tab-options').height();
// $(window).scroll(function (e) {
// s = $(document).scrolltop();
// console.log(s,t);
// if (s > t) {
// $('.tab-options').css('position', 'fixed');
// if (s > t) {
// $('.tab-options').css({'top': '100px', 'right': "0", "left": "0"});
// }
// } else {
// $('.tab-options').css('position', '');
// }
// })
// });
// }
//常见问题
$(".problem-list li").eq(0).addclass("cur");
$(".prob-cont").eq(0).show();
$(document).on("click", ".problem-list li h3", function () {
if ($(this).next().is(":hidden")) {
$(".prob-cont").slideup(300);
$(".problem-list li").removeclass("cur");
$(this).parents("li").addclass("cur");
$(this).next().slidedown(300);
} else {
$(this).parents("li").removeclass("cur");
$(this).next().slideup(300);
}
});
//// 资质荣誉弹窗
//var _popw = $(window).width() * 0.94 < 800 ? $(window).width() * 0.94 : 800;
//var _poph = $(window).height() * 0.65 < 600 ? $(window).height() * 0.65 : 600;
//var _poprate = _popw / _poph;
//function getslide(originimgs, popupswstr, numwrap) {
// var $thumb = $(originimgs);
// var $thumbswiper = $(popupswstr).html('');
// var slide_length = $thumb.length;
// for (var i = 0; i < slide_length; i++) {
// var $img = $thumb.eq(i);
// var imgw = $img.width();
// var imgh = $img.height();
// var rate = imgw / imgh;
// var $item = $('
');
// if (rate < _poprate) {
// $item.find('img').addclass('maxh');
// }
// ; $thumbswiper.append($item);
// }
// ; $(numwrap).html(slide_length);
//};
//getslide(".honor-list ul img,.environ-list ul img,.erespon-list ul img,.employee-min ul img", ".thumb-popup .swiper-wrapper", ".thumb-count");
//if (typeof swiper != 'undefined') {
// var thumbcopyswiper = new swiper(".thumb-copy-wrapper", {
// speed: 1000,
// prevbutton: '.swiper-left',
// nextbutton: '.swiper-right',
// loop: false,
// pagination: "",
// observer: true,
// observeparents: true,
// onslidechangestart: function (swiper) {
// var thistext = $(".honor-list li,.environ-list li,.erespon-list li,.employee-min li").eq(thumbcopyswiper.activeindex).find(" p").text();
// $(".thumbtext-list").html(thistext);
// $(".thumb-index").html(thumbcopyswiper.activeindex + 1);
// }
// });
//};
//$('.comloading').on('click', function () {
// getslide(".honor-list ul img,.environ-list ul img,.erespon-list ul img,.employee-min ul img", ".thumb-popup .swiper-wrapper", ".thumb-count");
//});
//$(document).on("click", ".honor-list li a,.environ-list li a,.erespon-list li a", function (ev) {
// ev.preventdefault();
// var thisindex = $(this).parents("li").index();
// var thistext = $(this).find(".elc-text").text();
// console.log(thisindex);
// thumbcopyswiper.slideto($(this).parents("li").index(), 0, false);
// $(".thumbtext-list").html(thistext);
// $(".thumb-index").html(thisindex + 1);
// $(".thumb-popup").fadein(300);
// $(".probg").fadein(300);
// var $height = $(window).height();
// $(".thumb-popup ul li").css("height", $height);
//});
$(".thumb-popup .close").click(function () {
$(".thumb-popup").fadeout(300);
$(".probg").fadeout(300);
});
function windowwidth() {
function itemheight(item,li) {
var heightarr = [];
// default
// $(item).find(li).css('height', 'auto');
// maxheight
$(item).find(li).each(function(){
heightarr.push($(this).outerheight());
});
var maxheight = math.max.apply(math, heightarr);
$(item).find(li).css('height', maxheight);
};
$(".header-nav li .sub-item ").each(function () {
if ($(this).find(".three-nav a").length > 0) {
$(this).find(".three-btn").show();
} else {
$(this).find(".three-btn").hide();
}
});
if($(window).width()>767){
itemheight(".inquirydel-list",".inqui-cont");
itemheight(".comculture-list",".content");
}
if ($(window).width() > 1023) {
$(window).scroll(function () {
var sticky = $('header');
var scrolls = $(window).scrolltop();
if (scrolls >10) {
sticky.addclass('shadow');
}else{
sticky.removeclass('shadow');
}
});
$(".indexbanner li").each(function () {
var thisindex = $(this);
var datecolor = thisindex.find(".bannertextcont").attr("data-color");
var dateclass = thisindex.find(".bannertextcont").attr("data-dq");
var listattr = thisindex.find(".bannertextcont").attr("style");
var thisimg = thisindex.find("a .img").attr("pc-img");
thisindex.find("a .img").attr("src", thisimg);
thisindex.find(".bannertextcont").attr("style", datecolor);
thisindex.find(".bannertextcont").addclass(dateclass);
});
if($(".scrollbox").length>0){
$(".scrollbox").scrollbar();
};
//导航
$(".headerweb,.search-con").unbind("click");
$(".childmenu .sub-nav").show();
$(".pcnavmenubtn").click( function () {
var winw = $(window).width();
var tempw = 320;
$('.exit-off-canvas').width(0);
$('.exit-off-canvas').width(winw - tempw);
$(".pcnav-btn").toggleclass("g_close");
$(".headsidenav").addclass("cur");
});
$('.exit-off-canvas,.slide-colse').click(function() {
var winw = $(window).width();
var tempw = 320;
$('.exit-off-canvas').width(0);
$(".headsidenav").removeclass("cur");
$(".pcnav-btn").removeclass("g_close");
});
//搜索
$(".search-con").unbind("mouseenter").bind("mouseenter", function () {
$(".searchbox").stop(true, true).fadein(300);
$('.sub-nav,.sub-bg').stop().slideup();
$(".pcnav-btn").removeclass("g_close");
});
$(".search-con").unbind("mouseleave").bind("mouseleave", function () {
$(".searchbox").stop(true, true).fadeout(300);
});
$(".headcompany").unbind("mouseenter").bind("mouseenter", function () {
$(".company-choose").stop(true, true).fadein(300);
$('.sub-nav,.sub-bg').stop().slideup();
$(".pcnav-btn").removeclass("g_close");
});
$(".headcompany").unbind("mouseleave").bind("mouseleave", function () {
$(".company-choose").stop(true, true).fadeout(300);
});
$(document).on("click",".headsidenav li",function () {
});
$(".headsidenav .slide-nav").html($(".header-nav ul").html());
$(document).on("click", ".slide-nav li h3", function () {
if ($(this).next().is(':hidden')) {
$(this).addclass('cur').next().stop().slidedown().parent().siblings().find('h3').removeclass('cur').next().stop().slideup();
} else {
$(this).removeclass('cur').next().stop().slideup();
}
});
// common-clumb
if($(".common-clumb-min").find(".common-clumb-box")){
$(".common-clumb-min .clumb-title").addclass("fl");
$(".common-clumb-min .common-clumb-box").addclass("fr")
};
$(".inside-subnav .subnav").show();
$(".inside-subnav .subnav ul").addclass("swiper-wrapper");
$(".subnav ul li").addclass("swiper-slide");
var navlistwid = 0;
var navlistlength = $(".inside-subnav .subnav ul li").length;
$(".inside-subnav .subnav ul li").each(function () {
var thisele = $(this);
navlistwid += thisele.outerwidth();
});
if (navlistwid > $(".inside-subnav .subnav").width()) {
$(".inside-subnav .sub-btn").show();
$(".inside-subnav .subnav").addclass("padding");
var swiper = new swiper('.inside-subnav .subnav', {
pagination: '',
nextbutton: '.sub-next',
prevbutton: '.sub-prev',
paginationclickable: true,
roundlengths: true,
slidesperview: "auto",
spacebetween: 0,
preventlinkspropagation: false
});
swiper.slideto($(".inside-subnav .subnav ul li.cur").index(), 0, false);
} else {
$(".inside-subnav .subnav ul").removeclass("swiper-wrapper");
$(".inside-subnav .subnav ul li").removeclass("swiper-slide");
$(".inside-subnav .sub-btn").hide();
};
$('.inside-subnav .subnav ,.third-cate .cate-list').show();
}
else {
// subnav
$(".subnav ul").removeclass("swiper-wrapper");
$(".subnav ul li").removeclass("swiper-slide");
$(".subnav").hide();
$(".contact-inside-subnav li").click(function () {
var text = $(this).text();
$(".channel-title").text(text);
$(".subnav ").stop().slideup();
});
$(".indexbanner li").each(function () {
var thisindex = $(this);
var listattr = thisindex.find(".bannertextcont").attr("style");
var thisimg = thisindex.find("a .img").attr("mobile-img");
thisindex.find("a .img").attr("src", thisimg);
thisindex.find(".bannertextcont").attr("style", "");
});
//移动端导航
$(".header-nav").hide();
$(".header-nav,.search-con").unbind("mouseenter");
$(".header-nav,.search-con").unbind("mouseleave");
//移动端展开下拉
$(".mobnav-btn").unbind("click").bind("click", function () {
$(".searchbox,.company-choose").hide();
if ($(".header-nav").is(":hidden")) {
$(this).addclass("g_close");
$(".header-nav").stop().slidedown();
$(".headlanguage").stop().slidedown();
}
else {
$(".header-nav").stop().slideup();
$(this).removeclass("g_close");
$(".headlanguage").stop().slideup();
}
});
// 头部语言切换
$('.headcompany').on('click', function (ev) {
ev.stoppropagation();
if ($(".company-choose").is(":hidden")) {
$('.company-choose').stop().slidedown();
$(".searchbox,.header-nav").hide();
$(".mobnav-btn").removeclass("g_close")
}
else {
$('.company-choose').stop().slideup();
}
});
//移动端二级导航
$(".header-nav li").each(function () {
if($(this).find(".sub-nav a").length>0){
$(this).find(".phsearchicon").show();
}
else{
$(this).find(".phsearchicon").hide();
}
});
$(".phsearchicon").unbind("click").bind("click", function () {
if ($(this).parents("li").find(".sub-item").is(":hidden")) {
$(this).parents("li").find(".sub-nav").stop().slidedown().parents("li").siblings().find(".sub-nav").stop().slideup();
$(this).parents("li").addclass("cur").siblings().removeclass("cur");
$(this).parents("li").siblings().find('.three-nav').slideup();
$(this).parents("li").siblings().find(".sub-item").removeclass("cur");
}
else {
$(this).parents("li").find(".sub-nav").stop().slideup();
$(this).parents("li").removeclass("cur");
$(this).parents("li").find('.three-nav').slideup();
$(this).parents("li").find(".sub-item").removeclass("cur");
}
});
// three-nav
$(".three-btn").unbind("click").bind("click", function () {
if ($(this).parents(".sub-item").find(".three-nav").is(":hidden") && $(this).parents(".sub-item").find(".three-nav a").length > 0) {
$(this).parents(".sub-item").find(".three-nav").stop().slidedown().parents(".sub-item").siblings().find(".three-nav").stop().slideup();
$(this).parents(".sub-item").addclass("cur").siblings().removeclass("cur");
}
else {
$(this).parents(".sub-item").find(".three-nav").stop().slideup();
$(this).parents(".sub-item").removeclass("cur");
}
});
//搜索
$(".search-inco").unbind("click").bind("click", function () {
$(".header-nav").hide();
$(".mobnav-btn").removeclass("g_close");
if ($(".searchbox").is(":hidden")) {
$(".searchbox").stop().slidedown();
}
else {
$(".searchbox").stop().slideup();
}
})
};
if($(window).width()>1279){
$(".header-nav").show();
//$('.header-nav').on('mouseenter', 'ul li', function() {
// var curchildul = $(this).find('.sub-nav');
// var curhaschild = curchildul ? curchildul.length : 0;
// var curleft = $(this).offset().left;
// var curhtml = '';
// if (curhaschild > 0) {
// curhtml = curchildul.prop("outerhtml");
// $('.childmenu').css('padding-left', curleft + 15 - $('.childmenu').offset().left).html(curhtml);
// $('.childmenu').addclass('active');
// } else {
// $('.childmenu').html('').removeclass('active');
// };
//});
//$('.header-nav').on('mouseleave', 'ul li', function() {
// $('.childmenu').removeclass('active');
//});
//$('.childmenu').hover(function() {
// $('.childmenu').addclass('active');
//}, function(e) {
// $('.childmenu').removeclass('active');
//});
$(".header-nav li").hover(function () {
if ($(this).find(".sub-nav a").length > 0) {
$(this).find(".sub-nav").stop(true, true).fadein(0);
}
}, function () {
$(this).find(".sub-nav").stop(true, true).fadeout(0);
});
$(".header-nav li .sub-item").hover(function () {
if ($(this).find(".three-nav a").length > 0) {
$(this).find(".three-nav").stop(true, true).fadein(0);
}
}, function () {
$(this).find(".three-nav").stop(true, true).fadeout(0);
});
}
// 2018.11.19
if ($(window).width() >= 1024) {
$(".sub-box").css("display", "block");
$(".footer ul li h3").unbind("click");
}
else {
$(".sub-box").css("display", "none");
$(".footer ul li h3").unbind("click").bind("click", function () {
if ($(this).next().is(":hidden")) {
$(".sub-box").slideup(300);
$(".footer ul li h3").removeclass("cur");
$(this).addclass("cur");
$(this).next().slidedown(300);
}
else {
$(this).removeclass("cur");
$(this).next().slideup(300);
}
});
}
}
});