//
$(function () {
function clientwidth() {
var zongwight = 12;
var clientwidth = document.documentelement.clientwidth;
if (clientwidth > 1200) {
clientwidth = 1200;
zongwight = 12;
}
document.documentelement.style.fontsize = clientwidth / zongwight + 'px';
$('html').css({'font-size':clientwidth / zongwight + 'px'});
}
$(window).resize(function () {
clientwidth();
});
clientwidth();
});
// var banner = new swiper('.banner .swiper-container', { // eslint-disable-line no-unused-vars
// autoplay: {
// delay: 3000,
// stoponlastslide: false,
// disableoninteraction: true,
// },
// speed: 1000,
// spacebetween : 20,
// pagination: {
// el: '.swiper-pagination_banner',
// },
// })
// banner.el.onmouseover = function(){
// banner.autoplay.stop();
// }
// banner.el.onmouseout = function(){
// banner.autoplay.start();
// }
/** 返回顶部 =======*/
$(function () {
var back = $('.back');
back.click(function () {
var timer = setinterval(function () {
$(window).scrolltop($(window).scrolltop() - 300);
if ($(window).scrolltop() == 0) {
clearinterval(timer);
}
}, 2);
});
});
//
(function(){
var h = 0;
$('.meun-btn').click(function(){
if(h === 0){
$(this).addclass('meun-btn-open');
$('.mark').fadein(300);
$('.second_nav').addclass('second_nav_block fadeinleftbig').removeclass('fadeoutleftbig');
h = 1;
} else{
$(this).removeclass('meun-btn-open');
$('.mark').fadeout(300);
$('.second_nav').addclass('fadeoutleftbig').removeclass('fadeinleftbig');
settimeout((function(){
$('.second_nav').removeclass('second_nav_block');
h = 0;
}), 500);
}
});
$('.second_nav_lsit li').click(function(){
$(this).find('dl').slidetoggle(300);
$(this).toggleclass('li_act');
$(this).siblings().removeclass('li_act');
$(this).siblings().find('dl').slideup(300);
});
})();
var hiswords = new swiper('.hiswords .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: false,
spacebetween : 0,
slidesperview : 1,
effect : 'fade',
fadeeffect: {
crossfade: true,
},
navigation: {
nextel: '.swiper-next_hisyesr',
prevel: '.swiper-prev_hisyesr',
},
on: {
slidechangetransitionstart: function (e) {
hisyesr.slideto(this.activeindex, 500, false);
$(".hisyesr .swiper-slide").eq(this.activeindex).addclass("swiper-slide-active").siblings().removeclass("swiper-slide-active");
}
}
})
var hisyesr = new swiper('.hisyesr .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: false,
spacebetween : 0,
slidesperview : 10,
on: {
slidechangetransitionstart: function (e) {
hiswords.slideto(this.activeindex, 500, false);
}
},
breakpoints: {
1200: {
slidesperview: 8,
},
919: {
slidesperview: 6,
},
767: {
slidesperview: 4,
},
413: {
slidesperview: 3,
},
},
});
$(".hisyesr .swiper-slide").click(function () {
var num = $(this).index();
$(this).addclass("swiper-slide-active").siblings().removeclass("swiper-slide-active");
hiswords.slideto(num, 500, false);
});
var soci5_swiper = new swiper('.soci5_swiper .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: false,
spacebetween : 5,
slidesperview : 4,
breakpoints: {
767: {
slidesperview: 2,
},
413: {
slidesperview: 2,
},
},
});
var pro_swiper = new swiper('.pro_swiper .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: false,
spacebetween : 5,
slidesperview : 4,
breakpoints: {
767: {
slidesperview: 2,
},
413: {
slidesperview: 2,
},
},
});
var soci6_swiper = new swiper('.prospic', { // eslint-disable-line no-unused-vars
autoplay: false,
spacebetween : 20,
slidesperview : 3,
pagination: {
el: '.prospic .swiper-pagination_pro',
type: 'progressbar',
},
breakpoints: {
767: {
slidesperview: 2,
},
413: {
slidesperview: 2,
},
},
});
$('.prospic div.swiper-slide').click(function () {
$(this).addclass('dd_act').siblings().removeclass('dd_act');
$('.provpic li').eq($(this).index()).fadein(0).siblings().hide(0)
});
var hotpic = new swiper('.hotpic .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: true,
spacebetween : 5,
slidesperview : 4,
breakpoints: {
767: {
slidesperview: 3,
},
413: {
slidesperview: 2,
},
},
navigation: {
nextel: '.swiper-next_hotpic',
prevel: '.swiper-prev_hotpic',
},
});
var map_swiper = new swiper('.map_swiper .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: false,
spacebetween : 0,
slidesperview : 5,
direction : 'vertical',
breakpoints: {
767: {
slidesperview: 3,
},
413: {
slidesperview: 2,
},
},
navigation: {
nextel: '.swiper-next_map_swiper',
prevel: '.swiper-prev_map_swiper',
},
observer:true, //监视器更新
observeparents:true,
observeslidechildren:true,
});
var zhao7_swiper = new swiper('.zhao7_swiper .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: {
delay: 1000,
stoponlastslide: false,
disableoninteraction: false,
},
spacebetween : 0,
slidesperview: 4,//一行显示3个
// loop: true,
breakpoints: {
767: {
slidesperview: 3,
},
413: {
slidesperview: 2,
},
},
});
/*人才招聘*/
$('.join_con_ul dl').click(function(){
$(this).parent('li').toggleclass('li_act').find('.words').slidetoggle(400);
});
var goto_swiper = new swiper('.goto_swiper .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: true,
spacebetween : 0,
slidesperview: 1,//一行显示3个
// loop: true,
parallax:"true",
direction: 'vertical',
});
//获取元素距离页面边缘的距离
function getoffset(box, direction) {
var setdirection = (direction == 'top')? 'offsettop': 'offsetleft';
var offset = box[setdirection];
var parentbox = box.offsetparent;
while (parentbox) {
offset += parentbox[setdirection];
parentbox = parentbox.offsetparent;
}
parentbox = null;
return parseint(offset);
}
//在线验证
function movecode(code) {
var fn = {
codevluae: code
};
var box = document.queryselector("#code-box"),
progress = box.queryselector("p"),
codeinput = box.queryselector('.code-input'),
evenbox = box.queryselector("span");
//默认事件
var boxeven = ['mousedown', 'mousemove', 'mouseup'];
//改变手机端与pc事件类型
if (typeof document.ontouchstart == 'object') {
boxeven = ['touchstart', 'touchmove', 'touchend'];
}
var gox,
offsetleft,
deviation,
evenwidth,
endx;
function movefn(e) {
e.preventdefault();
e = (boxeven['0'] == 'touchstart')? e.touches[0]: e || window.event;
endx = e.clientx - gox;
endx = (endx > 0)? (endx > evenwidth)? evenwidth: endx: 0;
if (endx > evenwidth * 0.7) {
progress.innertext = '松开验证';
progress.style.backgroundcolor = "#117374";
} else {
progress.innertext = '';
progress.style.backgroundcolor = "#117374";
}
progress.style.width = endx + deviation + 'px';
evenbox.style.left = endx + 'px';
}
function removefn() {
document.removeeventlistener(boxeven['2'], removefn, false);
document.removeeventlistener(boxeven['1'], movefn, false);
if (endx > evenwidth * 0.7) {
$(".form_submit").removeattr("disabled", false);
// $(".form_submit").addclass("form_submit_default");
$(".form_submit").removeclass("form_submit_default");
progress.innertext = '验证成功';
progress.style.width = evenwidth + deviation + 'px';
evenbox.style.left = evenwidth + 'px';
progress.style.backgroundcolor = "#117374";
// codeinput.value = fn.codevluae;
evenbox.onmousedown = null;
} else {
progress.style.width = '0px';
evenbox.style.left = '0px';
}
}
evenbox
.addeventlistener(boxeven['0'], function (e) {
e = (boxeven['0'] == 'touchstart')
? e.touches[0]
: e || window.event;
gox = e.clientx,
offsetleft = getoffset(box, 'left'),
deviation = this.clientwidth,
evenwidth = box.clientwidth - deviation,
endx;
document.addeventlistener(boxeven['1'], movefn, false);
document.addeventlistener(boxeven['2'], removefn, false);
}, false);
fn.setcode = function (code) {
if (code)
fn.codevluae = code;
}
fn.getcode = function () {
return fn.codevluae;
}
fn.resetcode = function () {
evenbox.removeattribute('style');
progress.removeattribute('style');
codeinput.value = '';
};
return fn;
}
// 研发中心轮播图
var ce_box2_b = new swiper('.ce_box2_b .swiper-container', { // eslint-disable-line no-unused-vars
autoplay: true,
spacebetween :25,
slidesperview :5,
breakpoints: {
767: {
slidesperview: 3,
},
413: {
slidesperview: 2,
},
},
navigation: {
nextel: '.ce_box2_b .swiper-next',
prevel: '.ce_box2_b .swiper-prev',
},
});
$('.ce_box4_b ul .ce_box4_ba').click(function(){
var x = $(this).index();
$(this).addclass('ce_box4_active').siblings().removeclass('ce_box4_active');
$('.ce_box4_b dl dd').eq(x).fadein(300);
$('.ce_box4_b dl dd').eq(x).siblings().fadeout(000);
});
$('#advantage ul li').click(function(){
var x = $(this).index();
$(this).addclass('act').siblings().removeclass('act');
$('.wordstop .words').eq(x).fadein(300);
$('.wordstop .words').eq(x).siblings().fadeout(000);
});