$(function(){ FastClick.attach(document.body); /*语言切换*/ $('.language').click(function(){ $(this).children('ul').stop().slideToggle('fast'); }); /*顶部搜索框*/ $('.search_btn').click(function(){ $(this).siblings('.search_form').fadeToggle('fast'); }); /*导航菜单*/ $('.nav li > a').mouseenter(function(){ $(this).parent().addClass('on').children('dl').show().end().siblings('li').removeClass('on').children('dl').hide(); if($(this).siblings('dl').length > 0){ $('.navBg').show(); } }); if($(window).width() > 1080){ $('.nav').mouseleave(function(){ $('.navBg').hide(); $(this).find('li').removeClass('on').children('dl').hide(); }); } $(window).resize(function(){ if($(window).width() > 1080){ $('.nav').mouseleave(function(){ $('.navBg').hide(); $(this).find('li').removeClass('on').children('dl').hide(); }); } }); /*手机导航菜单*/ $('.navBtn').click(function(){ $(this).toggleClass('open'); var $_scroll = $(window).scrollTop(); $('.nav').toggleClass('open'); if($('body').hasClass('open')){ var $_top = Math.abs($('body').offset().top); $('body').removeClass('open').css('top','auto'); $('body,html').scrollTop($_top); }else{ $('body').addClass('open').css('top',-$_scroll); } }); var $_navH = $(window).height() - $('.header').height(); if($(window).width() <= 1080){ $('.nav').height($_navH); } $(window).resize(function(){ var $_navH = $(window).height() - $('.header').height(); if($(window).width() <= 1080){ $('.nav').height($_navH); }else{ $('.nav').css('height','auto'); } }); $('.nav em').click(function(){ $(this).parent().toggleClass('on').children('dl').stop().slideToggle('fast'); $(this).parent().siblings('li').removeClass('on').children('dl').stop().slideUp('fast'); }); /*首页幻灯片*/ if($('#homeSlides').length > 0){ $('#homeSlides').owlCarousel({ items:1, loop:true, mouseDrag:true, autoplay:true, nav:false, dots:true }); } /*首页新闻中心*/ if($('#homeNews').length > 0){ $('#homeNews').owlCarousel({ items:1, loop:true, mouseDrag:true, autoplay:true, nav:false, dots:true }); } /*底部模块*/ $('.footBox img').load(function(){ if($(window).width() > 1080){ var $_heightB = '0'; $('.footBox').each(function(){ var $_getHeight = $(this).height(); $_heightB = $_heightB > $_getHeight ? $_heightB : $_getHeight; }); $('.footBox').height($_heightB); } $(window).resize(function(){ if($(window).width() > 1080){ var $_heightB = '0'; $('.footBox').each(function(){ var $_getHeight = $(this).height(); $_heightB = $_heightB > $_getHeight ? $_heightB : $_getHeight; }); $('.footBox').height($_heightB); } }); }); $('.follow .social .wx').click(function(){ $(this).toggleClass('open'); }); /*产品与系列_列表*/ $('.serList .serItem').eq(0).show(); $('.series li').click(function(){ $(this).addClass('cur').siblings().removeClass('cur'); var $_index = $(this).index(); $('.serList .serItem').eq($_index).fadeIn('fast').siblings().hide(); }); /*产品与系列_比较*/ $('.compare .title .col a').click(function(){ $('.compareAdd').fadeIn('fast'); }); $('.compareBox .close').click(function(){ $(this).parents('.compareAdd').fadeOut('fast'); }); /*产品与系列_详情*/ var $_details = '0'; $('.detailsTop .get').each(function(){ var $_d = $(this).height(); $_details = $_details > $_d ? $_details : $_d; }); $('.detailsTop .get').height($_details); $('.detailsTab li').eq(0).addClass('cur'); $('.detailsBox .itemBox').eq(0).show(); $('.detailsTab li').click(function(){ $(this).addClass('cur').siblings().removeClass('cur'); $_dIndex = $(this).index(); $('.detailsBox .itemBox').eq($_dIndex).fadeIn('fast').siblings().hide(); }); /*首页热门*/ if($('.home_hot').length > 0){ $('.home_hot').owlCarousel({ items:4, loop:true, mouseDrag:true, autoplay:true, nav:true, dots:true, responsiveClass:true, responsive:{ 0:{ items:1, nav:true }, 420:{ items:2, nav:true }, 768:{ items:4, nav:true, loop:false } } }); } /*CTDP实验室*/ $('.ctdpTech p').each(function(){ if($(this).children('img').length > 0){ $(this).children('img').parent().css('textIndent',0); } }); /*质量与认证*/ $('.certList li:nth-child(3n)').after('
'); var $_size = $('.certList li').size(); if($_size % 3 == 1 || $_size % 3 == 2){ $('.certList ul').append('
'); } /*国家工程中心*/ $('.pgWork img').load(function () { $('.fixedNav li').click(function () { $(this).addClass('cur').siblings().removeClass('cur'); }); var $_page1 = $('#page1').offset().top - 10; var $_page2 = $('#page2').offset().top - 10; var $_page3 = $('#page3').offset().top - 10; var $_page4 = $('#page4').offset().top - 10; var $_page5 = $('#page5').offset().top - 10; $(window).scroll(function () { var $_scroll = $(window).scrollTop(); if ($_scroll >= $_page1 && $_scroll < $_page2) { $('.fixedNav ul li').eq(0).addClass('cur').siblings().removeClass('cur'); } else if ($_scroll >= $_page2 && $_scroll < $_page3) { $('.fixedNav ul li').eq(1).addClass('cur').siblings().removeClass('cur'); } else if ($_scroll >= $_page3 && $_scroll < $_page4) { $('.fixedNav ul li').eq(2).addClass('cur').siblings().removeClass('cur'); } else if ($_scroll >= $_page4 && $_scroll < $_page5) { $('.fixedNav ul li').eq(3).addClass('cur').siblings().removeClass('cur'); } else if ($_scroll >= $_page5) { $('.fixedNav ul li').eq(4).addClass('cur').siblings().removeClass('cur'); } else { $('.fixedNav ul li').removeClass('cur'); } }); var $_pgTop = $('.pgWork .workIntro').offset().top; $(window).scroll(function () { var $_scroll2 = $(window).scrollTop(); if ($_scroll2 >= $_pgTop) { var $_num = $_scroll2 - $_pgTop + 155; setTimeout(function () { $('.fixedNav').stop().animate({ 'top': $_num }, 300) }, 50); } else { setTimeout(function () { $('.fixedNav').stop().animate({ 'top': '155px' }, 300) }, 50); } }); }); /*9888拉斯维加斯网站心旅*/ $('.pgShare .wx a').click(function () { $(this).siblings('span').fadeToggle('fast'); }); /*社会招聘*/ $('.scItem .job').click(function () { $(this).find('.btn').toggleClass('open'); $(this).siblings('.scCont').slideToggle('fast'); $(this).parent().siblings('.scItem').find('.scCont').slideUp('fast'); }); $('.box .btn').click(function () { $("#18268").empty(); $("#17767").empty(); $('.apply').fadeIn('fast'); var jobid = $(this).attr("jobid"); $("#17757").val(jobid); var jobname = $(this).attr("jobname"); $("#emname").text(jobname); var selectoption=""; var wordplace = $(this).attr("wordplace"); var arr=new Array(); //可以用字符或字符串分割 arr=wordplace.split('/'); selectoption+=""; for(var i=0;i"+arr[i]+""; } $("#18268").append(selectoption); var eduSelectoption=""; var edu = $(this).attr("edu"); var eduArr=new Array(); //可以用字符或字符串分割 eduArr=edu.split('/'); eduSelectoption+=""; for(var i=0;i"+eduArr[i]+""; } $("#17767").append(eduSelectoption); }); $('.apply .canel').click(function () { $('.apply').fadeOut('fast'); }); /*职位直通车*/ var $_mbHeight = '0'; $('.boxWrap .mtBox').each(function () { var $_thisH = $(this).children('.mtMain').height(); $_mbHeight = $_mbHeight > $_thisH ? $_mbHeight : $_thisH; }); $('.boxWrap .mtMain').height($_mbHeight); /*集团介绍*/ if ($('#hisYear').length > 0) { var hisYear = $('#hisYear'); hisYear.on('translated.owl.carousel ', function (e) { $_index = $('#hisYear .owl-dots .active').index(); $('#hisBox').trigger('to.owl.carousel', [$_index, 300]); if($('#hisYear .owl-stage-outer .active').next().length > 0){ $('#hisYear .owl-stage-outer .active').next().addClass('next').siblings().removeClass('next'); } if($('#hisYear .owl-stage-outer .active').next().next().length > 0){ $('#hisYear .owl-stage-outer .active').next().next().addClass('next2').siblings().removeClass('next2'); } if($('#hisYear .owl-stage-outer .active').prev().length > 0){ $('#hisYear .owl-stage-outer .active').prev().addClass('prev').siblings().removeClass('prev'); } if($('#hisYear .owl-stage-outer .active').prev().prev().length > 0){ $('#hisYear .owl-stage-outer .active').prev().prev().addClass('prev2').siblings().removeClass('prev2'); } }); hisYear.owlCarousel({ items:1, margin:8, loop:true, mouseDrag:true, autoplay:true, nav:false, dots:true, startPosition:3, autoplay:true, autoplayTimeout:4000, autoplayHoverPause:true }); } if ($('#hisBox').length > 0) { $('#hisBox').owlCarousel({ items:1, loop:true, mouseDrag:false, touchDrag:false, autoplay:false, nav:true, dots:false, startPosition:3, autoplayTimeout:4000 }); $('.hisBox .owl-prev').click(function () { $('#hisYear').trigger('prev.owl'); }); $('.hisBox .owl-next').click(function () { $('#hisYear').trigger('next.owl'); }); } /*生产基地*/ // if ($(window).width() > 1280) { // $('.mapWorld .item').hover(function () { // $(this).children('.info').fadeIn('fast').end().siblings('.item').children('.info').hide(); // },function(){ // $(this).children('.info').hide(); // }); // } // $(window).resize(function () { // if ($(window).width() > 1280) { // $('.mapWorld .item').click(function () { // $(this).children('.info').fadeIn('fast').end().siblings('.item').children('.info').hide(); // },function(){ // $(this).children('.info').hide(); // }); // } // }); /*销售网络*/ // $('.mapNet .item i').hover(function () { // $(this).siblings('.mapMain').fadeIn('fast').parent().siblings('.item').children('.mapMain').hide(); // },function(){ // $(this).siblings('.mapMain').hide(); // }); });