;(function ($, window, document, undefined) {
"use strict";
var wind_w = $(window).width();
var wind_h = $(window).height();
document.body.addeventlistener("touchstart", function () {
});
//导航
if (wind_w > 1100) {
$(".nav_case > a:not(.link_alone)").on("click.sty", function () {
$(".nav_case > a").removeclass("on");
$(this).addclass("on");
$(this).parents("header").addclass("header_on");
var thisleft = $(this).position().left;
$(this).parents(".nav_case").siblings(".nav_sed_box").find(".nav_sty_dot").css({
left: thisleft + "px"
})
});
$(".nav_case > a").on("mouseover", function () {
var thisleft = $(this).position().left;
$(this).parents(".nav_case").siblings(".nav_sed_box").find(".nav_sty_dot").css({
left: thisleft + "px"
})
});
$(".nav_case > a").on("mouseout", function () {
var thisleft = $(".nav_case > a.on").position().left;
$(this).parents(".nav_case").siblings(".nav_sed_box").find(".nav_sty_dot").css({
left: thisleft + "px"
})
});
//关闭二级导航
$(document).on("click", function (event) {
var eve = $(event.target);
if (eve.closest(".header_on").length == 0) {
$("header").removeclass("header_on");
} else {
console.log('点到元素了');
}
});
//点击出横导航
$(".full-menu_pc").on("click.stl", function () {
$("header").addclass("on");
});
// 滚动出横向导航
$(window).scroll(function () {
var thisscrtop = $(document).scrolltop();
if (thisscrtop >= 5) {
if (!$("header").hasclass("on")) {
$("header").addclass("on");
}
} else {
$("header").removeclass("on");
}
});
//语言切换样式
$(".language_box > a").on("click.sty", function () {
if (!$(this).hasclass('on')) {
$(".language_box > a").removeclass('on');
$(this).addclass("on");
}
});
}
//点击出横导航
// $(".full-menu_m").on("click.stl", function () {
// $("header").addclass("on");
// });
// 移动端二级导航切换
$('.menu-list > a ').on("click.sty", function () {
if ($(this).siblings("div").css("display") == "none") {
$('.menu-list > div').slideup(500);
$(this).siblings("div").slidedown(500);
}
});
// 内页banner 入场动画
$(".con_banner").addclass("on");
//内页banner 横线宽度
// window.onload=function () {
// var linew = $('.sty_line').parents('.sen_link_box').outerwidth() - $('.sty_line').siblings(".pre_box").outerwidth() - $('.sty_line').siblings('.sen_link_con').outerwidth();
// $('.sty_line').css({
// width: linew + 'px'
// })
// };
var linew = $('.sty_line').parents('.sen_link_box').outerwidth(true) - $('.sty_line').siblings(".pre_box").outerwidth(true) - $('.sty_line').siblings('.sen_link_con').outerwidth(true);
$('.sty_line').css({
width: linew - 1 + 'px'
});
//加入我们 选项卡切换
$(".post_title").on("click.sty", function () {
if ($(this).siblings(".post_condition").css("display") == "none") {
$(this).find('.post_num i').addclass('on');
$(this).siblings(".post_condition").slidedown(500);
} else {
$(this).find('.post_num i').removeclass('on');
$(this).siblings(".post_condition").slideup(500);
}
});
//人才理念
// var t = false ;
// $('.tal_tab_box > .tal_tab_name').on('mouseenter.sty',function ( e ) {
//
// e.preventdefault();
// e.stoppropagation();
//
// if ( ! t ) {
//
// t = true;
//
// if(!$(this).hasclass('on')){
//
// $(this).addclass("on").siblings(".tal_tab_name").removeclass('on');
// $('.tal_tab_box > .tal_tab_name .tal_tex_info').slideup(500);
// var thsiindex = $(this).index();
// $('.tal_img_box > div').removeclass("on").eq(thsiindex).addclass('on');
// $(this).find('.tal_tex_info').slidedown(500);
//
//
// }
//
// settimeout( function(){
// t = false;
// }, 500 );
// }
// // $('.tal_tab_box > .tal_tab_name .tal_tex_info').stop();
// });
// $('body').on('mouseenter.sty',function ( e ) {
// t = false;
// //console.log( e );
//
// });
$('.tal_tab_box > .tal_tab_name').on('click.sty', function (e) {
e.preventdefault();
e.stoppropagation();
if (!$(this).hasclass('on')) {
$(this).addclass("on").siblings(".tal_tab_name").removeclass('on');
// $('.tal_tab_box > .tal_tab_name .tal_tex_info').slideup(500);
var thsiindex = $(this).index();
$('.tal_img_box > div').removeclass("on").eq(thsiindex).addclass('on');
// $(this).find('.tal_tex_info').slidedown(500);
}
});
//公告及通函
if ($('body').hasclass('heng_box')) {
var detindex = $(".list_u_img_box a.on").index();
var detlefr = $(".list_u_img_box a.on").position().left;
var detviwwidth = $('.view_box').width();
var awidth = $(".list_u_img_box a.on").width();
var detnolenght = math.floor(detviwwidth / awidth);
var alength = $(".list_u_img_box a").length;
if (detindex < alength - detnolenght && !alength - detnolenght <= 0) {
$(".list_u_img_box ").css({
left: -detlefr + "px"
});
} else if (!alength - detnolenght <= 0 && detnolenght > alength) {
$(".list_u_img_box ").css({
left: 0 + "px"
});
} else {
var nleft = $(".list_u_img_box a").eq(alength - detnolenght).position().left;
$(".list_u_img_box ").css({
left: -nleft + "px"
});
}
if (detindex != 0) {
$(".btn_img_prev").removeclass("disab");
}
$(document).on('click', ".btn_img_next", function () {
var viwwidth = $('.view_box').width();
var obj = $(this).siblings(".view_box").find(".list_u_img_box");
var thisindex = obj.find(".on").index();
var thisleft = obj.find('.on').position().left;
var nextwidth = obj.find("a").eq(thisindex).width();
var nolenght = math.floor(viwwidth / nextwidth);
if (obj.find("a").length - thisindex <= 2) {
$(this).addclass("disab");
}
if (thisindex >= 0) {
$(this).siblings(".btn_img_prev").removeclass("disab");
}
obj.find("a").eq(thisindex + 1).addclass('on').siblings("a").removeclass('on');
if (thisindex < obj.find("a").length - nolenght) {
obj.css({
left: -(thisleft + nextwidth) + "px"
});
}
});
$(document).on('click', ".btn_img_prev", function () {
var viwwidth = $('.view_box').width();
var obj = $(this).siblings(".view_box").find(".list_u_img_box");
var thisindex = obj.find(".on").index();
var thisleft = obj.find('.on').position().left;
var nextwidth = obj.find("a").eq(thisindex - 1).width();
var nolenght = math.floor(viwwidth / nextwidth);
if (obj.find("a").length != thisindex) {
$(this).siblings(".btn_img_next").removeclass("disab");
}
console.log(thisindex);
if (thisindex <= 1) {
$(this).addclass("disab");
}
obj.find("a").eq(thisindex - 1).addclass('on').siblings("a").removeclass('on');
if (thisindex < obj.find("a").length - nolenght + 1) {
obj.css({
left: -(thisleft - nextwidth) + "px"
});
}
});
$('.list_u_img_box> a').on('click.sty', function () {
$(this).addclass('on').siblings("a").removeclass('on');
var thisindex = $(this).index();
});
}
//回到顶部
$(window).scroll(function () {
if ($(window).scrolltop() > 500) {
$(".go_top").fadein(500);
} else {
$(".go_top").fadeout(500);
}
});
//当点击跳转链接后,回到页面顶部位置
$(".go_top").on('click.sty', function () {
$('html,body').animate({
scrolltop: 0
}, 500)
});
//时间轴
if ($('body').hasclass('dev_box')) {
if ($(".list_u_img_box a").filter('.on').length == 0) {
$(".list_u_img_box a").first().addclass('on');
}
var detindex = $(".list_u_img_box a.on").index();
var detlefr = $(".list_u_img_box a.on").position().left;
var detviwwidth = $('.view_box').width();
var awidth = $(".list_u_img_box a.on").width();
var detnolenght = math.floor(detviwwidth / awidth);
var alength = $(".list_u_img_box a").length;
var time1 = $(".time_line_case").width();
console.log(detindex);
console.log(detnolenght);
if (detindex <= detnolenght) {
$(".list_u_img_box ").css({
left: 0 + "px"
});
} else if (detindex > detnolenght && detindex < (alength - detnolenght)) {
$(".list_u_img_box ").css({
left: -detlefr + "px"
});
} else if (detindex >= (alength - detnolenght)) {
$(".list_u_img_box ").css({
left: -(detlefr + awidth - detviwwidth) + "px"
});
}
if (detindex != 0) {
$(".btn_img_prev").removeclass("disab");
}
if (detindex == alength - 1) {
$(".btn_img_next").addclass("disab");
}
//默认显示内容
$(".dev_tex_box > div").eq(detindex).show();
//默认年份
var dettext = $(".list_u_img_box a.on").text();
$(".at_time > span").text(dettext);
$(document).on('click', ".btn_img_next", function () {
var viwwidth = $('.view_box').width();
var obj = $(this).siblings(".view_box").find(".list_u_img_box");
var thisindex = obj.find(".on").index();
var thisleft = obj.find('.on').position().left;
var nextwidth = obj.find("a").eq(thisindex).width();
var nolenght = math.floor(viwwidth / nextwidth);
if (obj.find("a").length - thisindex <= 2) {
$(this).addclass("disab");
}
if (thisindex >= 0) {
$(this).siblings(".btn_img_prev").removeclass("disab");
}
obj.find("a").eq(thisindex + 1).addclass('on').siblings("a").removeclass('on');
console.log(thisindex);
console.log(nolenght);
if (thisindex + 2 <= nolenght) {
$(".list_u_img_box ").css({
left: 0 + "px"
});
} else if (thisindex + 2 > nolenght && thisindex + 2 < (obj.find("a").length - nolenght)) {
obj.css({
left: -(thisleft + nextwidth) + "px"
});
} else if (thisindex + 2 >= (obj.find("a").length - nolenght)) {
var dleft = obj.find("a").eq(obj.find("a").length - nolenght).position().left;
obj.css({
left: -(thisleft + 2 * nextwidth - viwwidth) + "px"
});
}
$(".dev_tex_box > div").eq(thisindex + 1).show().siblings("div").hide();
$(".time_line_box > div").eq(thisindex + 3).addclass('on').siblings("div").removeclass("on");
var timedleft = $(".time_line_box > div").eq(thisindex + 4).position().left - time1 / 2;
$(".time_line_box").css({
left: -timedleft + "px"
});
var thistext = obj.find("a").eq(thisindex + 1).text();
$(".at_time > span").fadeout(500, function () {
$(this).remove();
$(".at_time").append("" + thistext + "")
})
});
$(document).on('click', ".btn_img_prev", function () {
var viwwidth = $('.view_box').width();
var obj = $(this).siblings(".view_box").find(".list_u_img_box");
var thisindex = obj.find(".on").index();
var thisleft = obj.find('.on').position().left;
var nextwidth = obj.find("a").eq(thisindex - 1).width();
var nolenght = math.floor(viwwidth / nextwidth);
if (obj.find("a").length != thisindex) {
$(this).siblings(".btn_img_next").removeclass("disab");
}
if (thisindex <= 1) {
$(this).addclass("disab");
}
obj.find("a").eq(thisindex - 1).addclass('on').siblings("a").removeclass('on');
if (thisindex < obj.find("a").length - nolenght + 1) {
obj.css({
left: -(thisleft - nextwidth) + "px"
});
}
$(".dev_tex_box > div").eq(thisindex - 1).show().siblings("div").hide();
$(".time_line_box > div").eq(thisindex + 1).addclass('on').siblings("div").removeclass("on");
var timedleft = $(".time_line_box > div").eq(thisindex + 2).position().left - time1 / 2;
$(".time_line_box").css({
left: -timedleft + "px"
});
var thistext = obj.find("a").eq(thisindex - 1).text();
$(".at_time > span").fadeout(500, function () {
$(this).remove();
$(".at_time").append("" + thistext + "")
})
});
$('.list_u_img_box> a').on('click.sty', function () {
$(this).addclass('on').siblings("a").removeclass('on');
var thisindex = $(this).index();
$(".dev_tex_box > div").eq(thisindex).show().siblings("div").hide();
var time2len = $('.list_u_img_box> a').length;
if (thisindex == 0) {
$(".btn_img_prev").addclass('disab');
} else {
$(".btn_img_prev").removeclass('disab');
}
if (thisindex == time2len - 1) {
$(".btn_img_next").addclass('disab');
} else {
$(".btn_img_next").removeclass('disab');
}
$(".time_line_box > div").eq(thisindex + 2).addclass('on').siblings("div").removeclass("on");
var timedleft = $(".time_line_box > div").eq(thisindex + 3).position().left - time1 / 2;
$(".time_line_box").css({
left: -timedleft + "px"
});
var thistext = $(this).text();
$(".at_time > span").fadeout(500, function () {
$(this).remove();
$(".at_time").append("" + thistext + "")
})
});
$(".time_line_box > div").css({
width: (time1 - 20) / 4 + "px"
});
var nopin = $(".time_line_box > div").length;
$(".time_line_box > div").eq(0).addclass("bodes");
$(".time_line_box > div").eq(1).addclass("bodes");
$(".time_line_box > div").eq(nopin - 2).addclass("bodes");
$(".time_line_box > div").eq(nopin - 1).addclass("bodes");
$(".time_line_box > div").eq(detindex + 2).addclass("on");
var timedleft = $(".time_line_box > div").eq(detindex + 3).position().left - time1 / 2;
$(".time_line_box").css({
left: -timedleft + "px"
});
$(".btn_time").on("click", function () {
$(this).parent("div").addclass('on').siblings("div").removeclass("on");
var thisinde = $(this).parent().index();
var timedleft = $(this).parent().position().left - time1 / 2 + $(this).parent().width();
$(this).parents(".time_line_box").css({
left: -timedleft + "px"
});
$(".dev_tex_box > div").eq(thisinde - 2).show().siblings("div").hide();
$('.list_u_img_box> a').eq(thisinde - 2).addclass('on').siblings("a").removeclass('on');
var time2len = $('.list_u_img_box> a').length;
var viwwidth = $('.view_box').width();
var nextwidth = $('.list_u_img_box> a').eq(0).width();
var nolenght = math.floor(viwwidth / nextwidth);
var thisleft = $('.list_u_img_box> a').eq(thisinde - 2).position().left;
if (thisinde - 2 <= nolenght) {
$(".list_u_img_box").css({
left: 0 + "px"
})
} else if (thisinde - 2 > nolenght && thisinde - 2 < (time2len - nolenght)) {
$(".list_u_img_box ").css({
left: -(thisleft + nextwidth) + "px"
});
} else if (thisinde - 2 >= (time2len - nolenght)) {
$(".list_u_img_box").css({
left: -(thisleft + 2 * nextwidth - viwwidth) + "px"
});
}
if (thisinde == 2) {
$(".btn_img_prev").addclass('disab');
} else {
$(".btn_img_prev").removeclass('disab');
}
if (thisinde == time2len + 1) {
$(".btn_img_next").addclass('disab');
} else {
$(".btn_img_next").removeclass('disab');
}
var thistext = $(this).children("span").text();
$(".at_time").addclass("ab_on").find("span").text(thistext);
settimeout(function () {
$(".at_time").removeclass("ab_on")
}, 500);
});
}
if ($("body").hasclass("swip_box")) {
// 团队领袖轮播
var teaswiper = new swiper('.swiper-container.tea_mem_case', {
effect: 'fade',
slideactiveclass: 'active',
// 如果需要前进后退按钮
navigation: {
nextel: '.tea_mem_case .swiper-button-next',
prevel: '.tea_mem_case .swiper-button-prev',
},
});
// 员工风采轮播
if ($("body").hasclass("swip_tab1")) {
var sib;
if (wind_w > 780) {
sib = 260;
} else {
sib = 100;
}
var caro1swiper = new swiper('.carousel .swiper-container', {
autoplay: {
delay: 3000,
stoponlastslide: false,
disableoninteraction: false,
},
watchslidesprogress: true,
slidesperview: 'auto',
centeredslides: true,
observer: true,
observeparents: true,
on: {
progress: function (progress) {
var i;
var modify;
var translate;
var scale;
var zindex;
for (i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
var slideprogress = this.slides[i].progress;
modify = 1;
if (math.abs(slideprogress) > 1) {
modify = (math.abs(slideprogress) - 1) * 0.3 + 1;
}
translate = slideprogress * modify * sib + 'px';
scale = 1 - math.abs(slideprogress) / 5;
zindex = 999 - math.abs(math.round(10 * slideprogress));
slide.transform('translatex(' + translate + ') scale(' + scale + ')');
slide.css('zindex', zindex);
slide.css('opacity', 1);
if (math.abs(slideprogress) > 3) {
slide.css('opacity', 0);
}
}
},
settransition: function (transition) {
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
slide.transition(transition);
}
}
},
slideactiveclass: 'active',
navigation: {
nextel: '.carousel .swiper-button-next',
prevel: '.carousel .swiper-button-prev',
},
});
//员工风采tab切换
var atleft = $('.sta_tab_box > span.on').position().left;
var atwidth = $('.sta_tab_box > span.on').outerwidth() / 2;
$('.sta_tab_mark').css({
left: atleft + atwidth + "px"
});
$('.sta_tab_box > span').on('click', function () {
$(this).addclass('on').siblings("span").removeclass('on');
var atleft = $(this).position().left;
var atwidth = $(this).outerwidth() / 2;
$('.sta_tab_mark').css({
left: atleft + atwidth + "px"
});
var thisindex = $(this).index();
$(".sta_tab_con_box > div").eq(thisindex).show().siblings("div").hide();
var caro1swiper = new swiper('.carousel .swiper-container', {
autoplay: {
delay: 3000,
stoponlastslide: false,
disableoninteraction: false,
},
watchslidesprogress: true,
slidesperview: 'auto',
centeredslides: true,
observer: true,
observeparents: true,
on: {
progress: function (progress) {
var i;
var modify;
var translate;
var scale;
var zindex;
for (i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
var slideprogress = this.slides[i].progress;
modify = 1;
if (math.abs(slideprogress) > 1) {
modify = (math.abs(slideprogress) - 1) * 0.3 + 1;
}
translate = slideprogress * modify * sib + 'px';
scale = 1 - math.abs(slideprogress) / 5;
zindex = 999 - math.abs(math.round(10 * slideprogress));
slide.transform('translatex(' + translate + ') scale(' + scale + ')');
slide.css('zindex', zindex);
slide.css('opacity', 1);
if (math.abs(slideprogress) > 3) {
slide.css('opacity', 0);
}
}
},
settransition: function (transition) {
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
slide.transition(transition);
}
}
},
slideactiveclass: 'active',
navigation: {
nextel: '.carousel .swiper-button-next',
prevel: '.carousel .swiper-button-prev',
},
});
});
}
//资质荣誉
if ($("body").hasclass("swip_tab2")) {
var sib, sib2, sib3;
if (wind_w > 780) {
sib = "vertical";
sib2 = 4;
sib3 = false;
} else {
sib = "horizontal";
sib2 = "auto";
sib3 = true;
}
var serswiper1 = new swiper('.hon_con_box1 .swiper-container', {
slideactiveclass: 'active',
effect: 'coverflow',
coverfloweffect: {
rotate: 50,
stretch: 10,
depth: 500,
modifier: 1,
slideshadows: true
},
speed: 1000,
spacebetween: 10,
autoplaydisableoninteraction: false,
autoplay: {
delay: 5000,
stoponlastslide: false,
disableoninteraction: false,
},
on: {
slidechangetransitionstart: function () {
updatenavposition0();
}
},
navigation: {
nextel: '.hon_name_box1 .swiper-button-next',
prevel: '.hon_name_box1 .swiper-button-prev',
},
observer: true,
observeparents: true,
});
var serpageswiper1 = new swiper('.hon_name_box1 .swiper-container', {
//visibilityfullfit: true,
direction: sib,
slidesperview: sib2,
allowtouchmove: false,
observer: true,
observeparents: true,
});
$('.hon_name_box1 .swiper-slide').on('click', function () {
var index = $(this).index();
//同步运行其它swiper
serswiper1.slideto(index);
});
function updatenavposition0() {
$('.hon_name_box1 .active-nav').removeclass('active-nav');
var activenav = $('.hon_name_box1 .swiper-slide').eq(serswiper1.activeindex).addclass('active-nav');
if (!activenav.hasclass('swiper-slide-visible')) {
if (activenav.index() > serpageswiper1.activeindex) {
var thumbspernav = math.floor(serpageswiper1.width / activenav.width());
serpageswiper1.slideto(activenav.index() - thumbspernav);
} else {
serpageswiper1.slideto(activenav.index());
}
}
}
var serswiper2 = new swiper('.hon_con_box2 .swiper-container', {
slideactiveclass: 'active',
effect: 'coverflow',
coverfloweffect: {
rotate: 50,
stretch: 10,
depth: 500,
modifier: 1,
slideshadows: true
},
speed: 1000,
spacebetween: 10,
autoplaydisableoninteraction: false,
navigation: {
nextel: '.hon_name_box2 .swiper-button-next',
prevel: '.hon_name_box2 .swiper-button-prev',
},
observer: true,
observeparents: true,
});
var serpageswiper2 = new swiper('.hon_name_box2 .swiper-container', {
//visibilityfullfit: true,
direction: sib,
slidesperview: sib2,
allowtouchmove: false,
observer: true,
observeparents: true,
preventclicks: false,//默认true
});
$('.hon_name_box2 .swiper-slide').on('click', function () {
var index = $(this).index();
//同步运行其它swiper
serswiper2.slideto(index);
});
serswiper2.on('slidechangetransitionstart', function () {
updatenavposition1();
// do stuff here
});
function updatenavposition1() {
$('.hon_name_box2 .active-nav').removeclass('active-nav');
var activenav = $('.hon_name_box2 .swiper-slide').eq(serswiper2.activeindex).addclass('active-nav');
if (!activenav.hasclass('swiper-slide-visible')) {
if (activenav.index() > serpageswiper2.activeindex) {
var thumbspernav = math.floor(serpageswiper2.width / activenav.width());
serpageswiper2.slideto(activenav.index() - thumbspernav);
} else {
serpageswiper2.slideto(activenav.index());
}
}
}
var serswiper3 = new swiper('.hon_con_box3 .swiper-container', {
slideactiveclass: 'active',
effect: 'coverflow',
coverfloweffect: {
rotate: 50,
stretch: 10,
depth: 500,
modifier: 1,
slideshadows: true
},
speed: 1000,
spacebetween: 10,
autoplaydisableoninteraction: false,
navigation: {
nextel: '.hon_name_box3 .swiper-button-next',
prevel: '.hon_name_box3 .swiper-button-prev',
},
observer: true,
observeparents: true,
});
var serpageswiper3 = new swiper('.hon_name_box3 .swiper-container', {
//visibilityfullfit: true,
direction: sib,
slidesperview: sib2,
allowtouchmove: false,
observer: true,
observeparents: true,
preventclicks: false,//默认true
});
$('.hon_name_box3 .swiper-slide').on('click', function () {
var index = $(this).index();
serswiper3.slideto(index);
});
serswiper3.on('slidechangetransitionstart', function () {
updatenavposition2();
});
function updatenavposition2() {
$('.hon_name_box3 .active-nav').removeclass('active-nav');
var activenav = $('.hon_name_box3 .swiper-slide').eq(serswiper3.activeindex).addclass('active-nav');
if (!activenav.hasclass('swiper-slide-visible')) {
if (activenav.index() > serpageswiper3.activeindex) {
var thumbspernav = math.floor(serpageswiper3.width / activenav.width());
serpageswiper3.slideto(activenav.index() - thumbspernav);
} else {
serpageswiper3.slideto(activenav.index());
}
}
}
var serswiper4 = new swiper('.hon_con_box4 .swiper-container', {
slideactiveclass: 'active',
effect: 'coverflow',
coverfloweffect: {
rotate: 50,
stretch: 10,
depth: 500,
modifier: 1,
slideshadows: true
},
speed: 1000,
spacebetween: 10,
autoplaydisableoninteraction: false,
navigation: {
nextel: '.hon_name_box4 .swiper-button-next',
prevel: '.hon_name_box4 .swiper-button-prev',
},
observer: true,
observeparents: true,
});
var serpageswiper4 = new swiper('.hon_name_box4 .swiper-container', {
//visibilityfullfit: true,
direction: sib,
slidesperview: sib2,
allowtouchmove: false,
observer: true,
observeparents: true,
preventclicks: false,//默认true
});
$('.hon_name_box4 .swiper-slide').on('click', function () {
var index = $(this).index();
//同步运行其它swiper
serswiper4.slideto(index);
});
serswiper4.on('slidechangetransitionstart', function () {
updatenavposition3();
});
function updatenavposition3() {
$('.hon_name_box4 .active-nav').removeclass('active-nav');
var activenav = $('.hon_name_box4 .swiper-slide').eq(serswiper4.activeindex).addclass('active-nav');
if (!activenav.hasclass('swiper-slide-visible')) {
if (activenav.index() > serpageswiper4.activeindex) {
var thumbspernav = math.floor(serpageswiper4.width / activenav.width());
serpageswiper4.slideto(activenav.index() - thumbspernav);
} else {
serpageswiper4.slideto(activenav.index());
}
}
}
// serswiper2.autoplay.stop();
// serswiper3.autoplay.stop();
// // serswiper4.autoplay.stop();
$('.hon_tab_nav_box > div').on('click', function () {
// serswiper1.autoplay.stop();
// serswiper2.autoplay.stop();
// serswiper3.autoplay.stop();
// serswiper4.autoplay.stop();
if ($('.hon_con_box4').length !=0) {
serswiper4.autoplay.stop();
}
if ($('.hon_con_box3').length !=0) {
serswiper3.autoplay.stop();
}
if ($('.hon_con_box2').length !=0) {
serswiper2.autoplay.stop();
}
if ($('.hon_con_box1').length !=0) {
serswiper1.autoplay.stop();
}
$(this).addclass('on').siblings("div").removeclass('on');
var thisindex = $(this).index();
$(".hon_con_case > div").eq(thisindex).show().siblings("div").hide();
if ($(".hon_con_case > div").eq(thisindex).find('.hon_con_box4').length !=0) {
serswiper4.autoplay.start();
}
if ($(".hon_con_case > div").eq(thisindex).find('.hon_con_box3').length !=0) {
serswiper3.autoplay.start();
}
if ($(".hon_con_case > div").eq(thisindex).find('.hon_con_box2').length !=0) {
serswiper2.autoplay.start();
}
if ($(".hon_con_case > div").eq(thisindex).find('.hon_con_box1').length !=0) {
serswiper1.autoplay.start();
}
});
}
// 公司概况
var comswiper = new swiper('.com_img_case .swiper-container', {
slideactiveclass: 'active',
// 如果需要前进后退按钮
navigation: {
nextel: '.com_img_case .swiper-button-next',
prevel: '.com_img_case .swiper-button-prev',
},
//分页器
// pagination: {
// el: '.com_img_case .swiper-pagination',
// type: 'custom',
// rendercustom: function (swiper, current, total) {
// return '0' + current + ' / ' + '0' + total;
// }
// },
});
}
//
if ($('body').hasclass('publ_body')) {
$('.publ_tab_nav_box > a').on("click.sty", function () {
if (!$(this).hasclass('on')) {
$(this).addclass('on').siblings('a').removeclass('on');
var thisindex = $(this).index();
$(this).parents('.publ_tab_nav_box').siblings("div").find('> div').eq(thisindex).show().siblings("div").hide()
}
});
}
if ($('body').hasclass('faq_body')) {
$('.faq_det_show').on('click.sty', function () {
if (!$(this).parent('div').hasclass('on')) {
$(this).parent("div").addclass('on');
} else {
$(this).parent("div").removeclass('on');
}
});
}
if ($('body').hasclass('sel_body')) {
$(".sel_drop_down > .sel_show").on("click", function () {
$(".drop_down_box").hide();
var csbox = $(this).siblings(".drop_down_box");
if (csbox.css("display") == "none") {
$(this).parents(".sel_drop_down").addclass("down_open");
csbox.slidedown(500);
$(this).children("i").addclass("on")
} else {
csbox.css("display", "none");
$(this).parents(".sel_drop_down").removeclass("down_open");
$(this).children("i").removeclass("on")
}
});
$(".drop_down_box li").on("click", function () {
$(this).addclass("on").siblings("li").removeclass("on");
var thistext = $(this).text();
$(this).parents(".sel_drop_down").removeclass(".down_open").find(".sel_show > span").text(thistext);
$(this).parents(".drop_down_box").hide().siblings('input').val(thistext);
$(".sel_show > i").removeclass("on")
});
$(document).on("click", function (event) {
var eve = $(event.target);
if (eve.closest(".down_open").length == 0) {
$(".sel_drop_down").addclass("down_open");
$(".drop_down_box").hide();
$(".sel_show > i").removeclass("on")
} else {
console.log('点到元素了');
}
});
//搜索框下拉结束
}
if ($('body').hasclass('sea_body')) {
var marleft;
if (wind_w > 640) {
marleft = 30;
} else {
marleft = 10;
}
var swwidth = 0;
$(".sea_nav_box a").each(function () {
var thisw = $(this).outerwidth(true) + marleft;
swwidth += thisw;
return swwidth
});
var faw = $('.sea_res_con_box').outerwidth(true);
if (swwidth > faw) {
var seaswiper = new swiper('.sea_nav_box .swiper-container', {
slideactiveclass: 'active',
autoplaydisableoninteraction: false,
slidesperview: 'auto',
spacebetween: marleft,
navigation: {
nextel: '.sea_nav_box .swiper-button-next',
prevel: '.sea_nav_box .swiper-button-prev',
},
observer: true,
observeparents: true,
});
} else {
$('.sea_nav_box').addclass("sea_center");
}
// tab切换
$(".sea_nav_box a").on('click.sty', function () {
if (!$(this).hasclass('on')) {
$(".sea_nav_box a").removeclass('on');
$(this).addclass('on');
var thisindex = $(this).parent(".swiper-slide").index();
console.log(thisindex);
$(this).parents(".sea_nav_box").siblings('.sea_res_con_box').children('div').eq(thisindex).show().siblings("div").hide();
}
});
}
$('.sha_btn_close').on('click.sty', function () {
$(this).parent('.sha_con_box').hide();
$('.sha_bg').hide();
});
$('.btn_sha').on('click.sty', function () {
$('.sha_bg').show();
$('.sha_con_box_inquiry').show();
$('html,body').animate({
scrolltop: 0
}, 500)
});
$('.btn_edit').on('click.sty', function () {
if (!$(this).parents('.sha_con_box').hasclass('edit_box')) {
!$(this).parents('.sha_con_box').addclass('edit_box')
}
})
if ($('body').hasclass('pro_det_body')) {
var drawmain = function (drawing_elem, percent, forecolor, bgcolor) {
// @drawing_elem: 绘制对象
// @percent:绘制圆环百分比, 范围[0, 100]
// @forecolor: 绘制圆环的前景色,颜色代码
// @bgcolor: 绘制圆环的背景色,颜色代码
var context = drawing_elem.getcontext("2d");
var center_x = drawing_elem.width / 2;
var center_y = drawing_elem.height / 2;
var rad = math.pi * 2 / 100;
var speed = 0;
var rwidth = 16; //线的粗细 8
// 绘制背景圆圈
function backgroundcircle() {
context.save();
context.beginpath();
context.linewidth = rwidth;
//设置线宽
var radius = center_x - context.linewidth;
context.linecap = "round";
context.strokestyle = bgcolor;
context.arc(center_x, center_y, radius, 0, math.pi * 2, false);
context.stroke();
context.closepath();
context.restore();
}
//绘制运动圆环
function foregroundcircle(n) {
context.save();
context.strokestyle = forecolor;
context.linewidth = rwidth;
context.linecap = "round";
var radius = center_x - context.linewidth;
context.beginpath();
context.arc(center_x, center_y, radius, -math.pi / 2, -math.pi / 2 + n * rad, false);
//用于绘制圆弧context.arc(x坐标,y坐标,半径,起始角度,终止角度,顺时针/逆时针)
context.stroke();
context.closepath();
context.restore();
}
//绘制文字
function text(n) {
context.save();
//save和restore可以保证样式属性只运用于该段canvas元素
context.fillstyle = forecolor;
var font_size = 40;
context.font = font_size + "px helvetica";
var text_width = context.measuretext(n.tofixed(0) + "%").width;
context.filltext(n.tofixed(0) + "%", center_x - text_width / 2, center_y + font_size / 2);
context.restore();
}
//执行动画
(function drawframe() {
window.requestanimationframe(drawframe);
context.clearrect(0, 0, drawing_elem.width, drawing_elem.height);
backgroundcircle();
// text(speed);
foregroundcircle(speed);
if (speed >= percent) return;
speed += 1;
}());
};
var topp = $(document).scrolltop();
var thist = $('.det_proportion_box').offset().top - $(window).height();
if (topp > thist) {
if (!$('.det_proportion_box').hasclass('on')) {
$('.det_proportion_box').addclass('on');
var vnum, time_canvas, nnum;
$('.time-graph-canvas').each(function () {
vnum = $(this).data('value');
nnum = $(this).data('nnum');
time_canvas = document.getelementbyid('time-graph-canvas' + nnum + '');
// return vnum,time_canvas;
drawmain(time_canvas, vnum, "#07933d", "#d5dbe0");
});
}
} else if (topp < thist) {
$('.det_proportion_box').removeclass('on');
}
$(window).on('scroll touchmove', function () {
var topp = $(document).scrolltop();
var thist = $('.det_proportion_box').offset().top - $(window).height();
if (topp > thist) {
if (!$('.det_proportion_box').hasclass('on')) {
$('.det_proportion_box').addclass('on');
var vnum, time_canvas, nnum;
$('.time-graph-canvas').each(function () {
vnum = $(this).data('value');
nnum = $(this).data('nnum');
time_canvas = document.getelementbyid('time-graph-canvas' + nnum + '');
// return vnum,time_canvas;
drawmain(time_canvas, vnum, "#07933d", "#d5dbe0");
});
}
} else if (topp < thist) {
$('.det_proportion_box').removeclass('on');
}
})
}
})(jquery, window, document);