aos.init({
easing: 'ease-out-back',
duration: 1000,
placement: 'top-center',
once: true
});
// 内页图片碎片化
var _default={width:1200,line:5,column:12,img:'',animetime:3000};
function fragmentimg(changeconfig){if(typeof(changeconfig)=="object"){for(var n in changeconfig){_default[n]=changeconfig[n]}}if(!_default.container){alert('未选择显示容器(div.class or div#id)的类');return false}var container=$(_default.container);container.append("
");container.css({width:_default.width});var containerul=container.find(" > ul");for(var i=0;i<(_default.line*_default.column);i++){containerul.append(" ")}var containeritem=containerul.find("li");var img=new image();img.src=_default.img;img.onload=function(){var multiple=container.width()/img.width,width=img.width*multiple,height=img.height*multiple,findwidth=width/_default.column,findheight=height/_default.line;var windowwidth=screen.width,windowheight=screen.height;containeritem.css({width:findwidth,height:findheight,'background-image':'url('+img.src+')','background-size':width+'px '+height+'px',opacity:0});container.css({left:'50%',top:'50%','margin-top':-height/2,'margin-left':-width/2});var x,y;for(i=0;i ')
if($('.pageban .textbox').length != 0){
$('.pageban .textbox').addclass('cur');
}
$('.headtop .line, .logo').addclass('cur');
//响应式执行js
var windw = $(window).width();
if(windw < 1024){
banner('.m-bann');
$('.headnavitem .name').click(function(){
$(this).toggleclass('cur');
$(this).siblings('.navchilditems').slidetoggle(500)
$(this).closest('.headnavitem').siblings().find('.navchilditems').slideup(500)
$(this).closest('.headnavitem').siblings().find('.name').removeclass('cur');
})
$('.footmaplist .name').click(function(){
$(this).closest('.footmaplist').toggleclass('cur').siblings().removeclass('cur')
$(this).siblings('.childbox').slidetoggle(500)
$(this).closest('.footmaplist').siblings().find('.childbox').slideup(500)
})
//子页面子级导航展开事件
$('[pagenavclick]').on('click',function(){
if($(this).siblings('[showbox]').length == 1) $(this).toggleclass('cur').siblings('[showbox]').slidetoggle(200);
})
$('.wapbtnbox').click(function(){
$(this).toggleclass('cur');
$('.navleft').toggleclass('cur');
$('.head').toggleclass('cur');
$('html, body').toggleclass('cur');
})
$('.navitemname').click(function(){
$(this).toggleclass('cur').siblings('.navchildbox').slidetoggle(400);
$(this).closest('.navitem').siblings().find('.navitemname').removeclass('cur').siblings('.navchildbox').slideup(400)
})
$('.wapscrolltop, .scrolltop').click(function(){
$('html, body').animate({scrolltop: '0'}, 1000)
})
$('.logintop').click(function(){
$(this).closest('.login').toggleclass('cur')
})
var ibw = 0;
$('.indexb1item').each(function(){
ibw += $(this).width();
})
//$('.indexb1items').css({'width': ibw + 225})
$('.indexb1items').css({ 'width': ibw + 275 })
var icswiper = new swiper('.indexcbot .swiper-container', {
watchslidesprogress: true,
slidesperview: 'auto',
freemode: true,
centeredslides: true,
loop: true,
loopfillgroupwithblank: true,
pagination: {
el: '.indexcbot .swiper-pagination',
clickable: true,
},
on: {
progress: function(progress) {
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.25 + 1;
}
translate = slideprogress * modify * 200 + 'px';
scale = 1 - math.abs(slideprogress) / 14;
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) {
// if(windw > 993){
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i)
slide.transition(transition);
}
// }
}
}
});
$('.footfriendtop').click(function(){
$(this).closest('.footfriend').toggleclass('cur')
})
$('.searchform .btn').html('搜索');
$('.searchbox .bg').click(function(){
$('.searchbox').removeclass('cur');
$('.head .box').removeclass('cur');
// $('.head').removeclass('cur');
$('#searchval').blur();
$('html, body').toggleclass('cur');
})
$('.navitem').each(function(){
var i = $(this).index();
if(i != 0){
$(this).find('.showname').attr('href', 'javascript:;');
}
})
// $('.navitemname .showname').attr('href', 'javascript:;')
}else{
function detectzoom (){
var ratio = 0,
screen = window.screen,
ua = navigator.useragent.tolowercase();
if (window.devicepixelratio !== undefined) {
ratio = window.devicepixelratio
}else if (~ua.indexof('msie')) {
if (screen.devicexdpi && screen.logicalxdpi) ratio = screen.devicexdpi / screen.logicalxdpi;
}else if (window.outerwidth !== undefined && window.innerwidth !== undefined) {
ratio = window.outerwidth / window.innerwidth;
}
if(ratio) ratio = math.round(ratio * 100);
return ratio;
};
isscale();
$(window).on('resize',function(){ isscale() });
//判断pc端浏览器缩放比例不是100%时的情况
function isscale(){
//var rate = detectzoom();
//if(rate != 100) alert('当前页面不是标准100%显示,为防止浏览器出错,请按键盘ctrl+0恢复100%显示标准!');
}
banner('.pcbanner');
$(window).scroll(function(){
var t = $(this).scrolltop();
if($('.histbox')[0]){
var hist = $('.histbox').offset().top - $(window).height() / 2;
if(t >= hist){
$('.histbox .line').addclass('cur')
}
}
})
// $('.scrolltop').click(function(){
// $('html, body').stop().animate({"scrolltop": 0}, 1000)
// })
$('.scrolltop').click(function(){
$('html, body').animate({scrolltop: '0'}, 500)
})
function sol1(){
if($('.solution1box')[0]){
var t = setinterval(function(){
var a = ""
$('.solution1box .img').each(function(){
a = $(this).find('img')[0].complete;
})
if(a == true){
clearinterval(t);
$('.solution1box .textbox').css({
'height': $('.solution1box .img').eq(0).height()
})
}
}, 300)
}
}
// sol1();
$(window).resize(function(){
// sol1();
indexa();
})
function indexa(){
var iahb = $('.indexavideobox .img img');
var iat = setinterval(function(){
var a = ""
iahb.each(function(){
a = $(this)[0].complete;
})
if(a == true){
clearinterval(iat);
$('.indexa .swiper-button-next, .indexa .swiper-button-prev').css({'bottom': $('.indexavideobox .img img').height() / 2 - 22})
}
}, 300)
}
indexa();
$('.head').hover(function(){
$(this).addclass('cur');
},function(){
if($(window).scrolltop() == 0){
$(this).removeclass('cur')
}
})
$('.sidebar li').hover(function(){
$(this).toggleclass('linow')
})
function navhead(){
var wt = $(window).scrolltop();
if(wt >= 100 || $('.newsdetail')[0]){
$('.head').addclass('cur');
}
$(window).scroll(function(){
var t = $(this).scrolltop();
if(t >= 100){
$('.head').addclass('cur');
}else{
if($('.newsdetail')[0] == undefined){
$('.head').removeclass('cur');
}
}
})
}
navhead();
$('.sidebar .btn').click(function(){
$(this).closest('.sidebar').toggleclass('cur');
})
$('.searchbox .close').click(function(){
$('.searchbox').removeclass('cur');
$('.head .box').removeclass('cur');
// $('.head').removeclass('cur');
$('#searchval').blur()
})
}
$(window).scroll(function(){
var t = $(this).scrolltop();
if($('[allbanner]')[0]){
if(t >= $('[allbanner]').height()){
$('.scrolltop').addclass('cur')
}else{
$('.scrolltop').removeclass('cur')
}
}else if($('.newsdetail')[0]){
if(t >= 500){
$('.scrolltop').addclass('cur')
}else{
$('.scrolltop').removeclass('cur')
}
}
})
$('.bandown').click(function(){
var sct = $(this).closest('.indexban').next().offset().top;
$('html,body').animate({scrolltop: sct},500)
})
$('.searchbtn').click(function(){
$('.searchbox').toggleclass('cur');
$('.head .box').toggleclass('cur');
// $('.head').toggleclass('cur');
$('#searchval').focus();
if(windw <= 1024){
$('html, body').toggleclass('cur');
}
})
function makesvg(percentage){
var abs_percentage=math.abs(percentage).tostring();
var percentage_str=percentage.tostring();
var svg = ''
+ ' '
+ ' '
+ ' ';
return svg
}
function banner(obj, s){
var banswiper = new swiper(''+obj+'', {
speed: 1000,
autoplay: {
delay: 4500,
disableoninteraction: false
},
loop: true,
loopfillgroupwithblank: true,
effect: 'fade',
pagination: {
el: ''+obj+' .swiper-pagination',
clickable: true
},
navigation: {
nextel: ''+obj+' .swiper-button-next',
prevel: ''+obj+' .swiper-button-prev',
},
on: {
init: function(){
var i = this.activeindex;
$(''+obj+' .swiper-slide').eq(i).find('.textbox').addclass('cur');
settimeout(function(){
$('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet').append('
');
var p = $('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet .circlechart').attr('data-percentage');
$('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet .circlechart').html( makesvg(p))
$('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet').eq(0).addclass('one')
},500)
},
slidechangetransitionend: function(){
var i = this.activeindex;
$(''+obj+' .swiper-slide').eq(i).find('.textbox').addclass('cur');
$(''+obj+' .swiper-slide').eq(i).siblings().find('.textbox').removeclass('cur');
}
}
})
}
$('.recruititem').each(function(){
var h = $(this).find('.bigbox').height();
$(this).find('.textbox').css('max-height', h)
})
$('.recruititem .more').click(function(){
if(windw > 1014){
$(this).closest('.recruititem').toggleclass('cur');
$(this).closest('.recruititem').siblings().addclass('cur')
}else{
$(this).closest('.recruititem').toggleclass('cur')
$(this).closest('.recruititem').siblings().addclass('cur')
}
})
function conscroll(){
$(window).scroll(function(){
var t = $(this).scrolltop(),
bt = $('.contact2').offset().top;
if(t >= bt - t) $('.conline').addclass('cur');
})
}
if($('.conline').length == 1) conscroll();
$('.ibvideobox .playerbox').click(function(){
var vsrc = $(this).closest('.ibvideobox').attr('vsrc');
$(this).closest('.ibvideobox').find('video').attr('src', '')
if($(this).closest('.ibvideobox').find('video').attr('src') == ""){
$(this).closest('.ibvideobox').find('video').attr('src', vsrc);
$(this).closest('.ibvideobox').addclass('cur');
// $(this).closest('.ibvideobox').find('video')[0].load();
var playpromise = $(this).closest('.ibvideobox').find('video')[0].play()
$(this).closest('.ibvideobox').find('video')[0].webkitrequestfullscreen();
if (playpromise !== undefined) {
playpromise.then(function(){
$(this).closest('.ibvideobox').find('video')[0].play()
$(this).closest('.ibvideobox').find('video')[0].webkitrequestfullscreen();
}).catch(function(){
})
}
}
})
//var eq2swiper = new swiper('.equip2slide .swiper-container', {
// slidesperview: 4,
// spacebetween: 33,
// slidespergroup: 1,
// navigation: {
// nextel: '.equip2slide .swiper-button-next',
// prevel: '.equip2slide .swiper-button-prev',
// },
// breakpoints: {
// 768: {
// slidesperview: 1,
// spacebetween: 0,
// },
// 1024: {
// slidesperview: 2,
// spacebetween: 20,
// },
// }
//});
//function eq3(){
// var imgarry = [];
// $('.equip3slide .swiper-slide .img').each(function(){
// var imgsrc = $(this).find('img').attr('src'),
// name = $(this).siblings('.title').html();
// imgarry.push({'name': name, 'img': imgsrc});
// })
// for(var i=0;i