$(document).ready(function($){ //人才招聘 var oldind=onind=-1; $(".joinpost_list_title").click(function(){ $(".joinpost_list_content").slideup(); $(".joinpost_list_title").removeclass("on") $(".social1").css("display","block"); $(".social2").css("display","none"); onind=$(this).parent().index(); if(oldind!=onind){ $(this).addclass("on") $(this).next().slidedown(); $(this).find(".social1").css("display","none"); $(this).find(".social2").css("display","block"); oldind=onind }else{ oldind=-1; } }); //banner特效 $(".slick-dots li").click(function(){ $(".slick-hero-slider .image-bg").addclass("on"); settimeout(function(){ $(".slick-hero-slider .image-bg").removeclass("on"); }, 3000); }); //联系我们点击留言表单 $(".window_click").click(function(){ $(".window").show(); }); $(".close,.window_bg").click(function(){ $(".window").hide(); }); //头部导航定 $(function(){ fixed_menu(".pc_top"); }); function fixed_menu(obj){ var m_top=$(obj).offset().top; $(window).scroll(function () { if ($(window).scrolltop() > 100) { $(obj).addclass("on"); }else{ $(obj).removeclass("on"); } }); }; //内页banner var sh=-1,nh=0; var h=window.setinterval(function(){ var ww=parseint($(window).width()); var oldh=470; if(ww<1200){ sh=ww/1200*oldh; }else{ sh=oldh; } if(nh!=sh){ sh>240?sh:sh=100; $(".neibanner,.neibanner_content").height(sh); nh=sh; } },200); //手机端禁止滑动屏幕 function touchmove(){//自定义函数 $("body").on("touchmove",function(event){ event.preventdefault; }, false) } function touchmove2(){//自定义函数 $("body").off("touchmove"); } var flag=true; $('.cd-nav-trigger').on('click', function () { if(flag){ flag=false; touchmove(); } else{ flag=true; touchmove2(); } }); //手机端导航 function responsive() { if($(window).width() <= 1200){ console.log('mobile navigation'); $('#mo_nav').infinitypush(); $('body').removeclass('desktop'); } else { console.log('desktop navigation'); $('#mo_nav').infinitypush({ destroy:true }); $('body').addclass('desktop'); } } function windowresize(){ $(window).resize(function(){ responsive(); }); } responsive(); windowresize(); var islateralnavanimating = false; //open/close lateral navigation $('.cd-nav-trigger').on('click', function(event){ event.preventdefault(); if( !islateralnavanimating ) { if($(this).parents('.csstransitions').length > 0 ) islateralnavanimating = true; $('body').toggleclass('navigation-is-open'); $('.ma-infinitypush-wrapper').toggleclass('on'); $('.cd-navigation-wrapper').one('webkittransitionend otransitionend otransitionend mstransitionend transitionend', function(){ //animation is over islateralnavanimating = false; }); } }); });