$(function() { //引用layer layui.use(['layer','laydate','upload','form'], function(){ var layer = layui.layer; var element = layui.element; }); const ww=$(window).width(); //顶部搜索固定 $("header .search .toggle .search-input input").focus(function(){ $(this).parent('.search-input').parent('.toggle').addclass('cur'); }); $(".search-go").click(function(){ $(this).parent('.toggle').removeclass('cur'); }); $('header .hflist ul li .box').click(function(){ $(this).next('.toggle').removeclass('cur'); }); /*导航手机端菜单按钮 点击隐藏显示*/ $(".phone-toggle").click(function() { $('body').toggleclass('active'); $('header').toggleclass('active'); $('header .menu li.menuli .box').removeclass('on'); $('header .menu li.menuli .box1').removeclass('cur'); $('header .menu .menuli .toggle').slideup(); $('header .menu .menuli .moretoggle').slideup(); return false; }); /*导航下属公司 语言 点击隐藏显示*/ $("header .navigation .lang").click(function() { //判断导航是否手机样式 var is_ture=$('header.layui-header').is('.active'); if(is_ture){ $(this).children('.toggle').toggleclass('active'); $('header .menu .menuli .box').removeclass('on'); $('header .menu .menuli .toggle').slideup(); $("header .navigation .company").children('.toggle').removeclass('active'); var is_act=$(this).children('.toggle').is(".active"); if(is_act){ $(document).bind("click",function(e){ var target = $(e.target); if(target.closest("header .navigation .lang").length == 0){ $('header .navigation .lang .toggle').removeclass('active'); } e.stoppropagation(); }) } } }); $("header .navigation .company").click(function() { //判断导航是否手机样式 var is_ture=$('header.layui-header').is('.active'); if(is_ture){ $(this).children('.toggle').toggleclass('active'); $('header .menu .menuli .box').removeclass('on'); $('header .menu .menuli .toggle').slideup(); $("header .navigation .lang").children('.toggle').removeclass('active'); var is_act=$(this).children('.toggle').is(".active"); if(is_act){ $(document).bind("click",function(e){ var target = $(e.target); if(target.closest("header .navigation .company").length == 0){ $('header .navigation .company .toggle').removeclass('active'); } e.stoppropagation(); }) } } }); $("header .menu li.menuli .box").click(function() { //判断导航是否手机样式 var is_ture=$('header.layui-header').is('.active'); if(is_ture){ //导航下拉 var is_on=$(this).is('.on'); if(is_on){ $(this).removeclass('on'); $(this).next('.toggle').slideup(); }else{ $(this).addclass('on').parent('li').siblings().children('.box').removeclass('on'); $(this).next(".toggle").slidedown().parent('li').siblings().children('.toggle').slideup(); } }; }); $('header .menu .menuli .toggle li .box1').click(function() { //判断导航是否手机样式 var is_ture=$('header.layui-header').is('.active'); if(is_ture){ var is_cur=$(this).is('.cur'); if(is_cur){ $(this).removeclass('cur'); $(this).next(".moretoggle").slideup(); }else{ $(this).addclass('cur').parent('li').siblings().children('.box1').removeclass('cur'); $(this).next(".moretoggle").slidedown().parent('li').siblings().children('.moretoggle').slideup(); } }; }); //跳动数字 var jnumber=$(".animatenum"); jnumber.each(function(){ var _thistext=$(this).text(); var nonumber=_thistext.replace(/[^0-9]+/g, ''); $(this).attr("data-animatetarget",nonumber); }); //底部点击事件 $("footer .server li").click(function() { $(this).toggleclass('active'); //$("footer .server li").eq($(this).index()).addclass("active").siblings().removeclass('active'); }); //二维码弹出 $('footer .logo ul li.flk1').$imgbox('footer .logo ul li.flk1',1); $('footer .logo ul li.flk3').$imgbox('footer .logo ul li.flk3',1); $('footer .logo ul li.flk4').$imgbox('footer .logo ul li.flk4',1); //返回顶部 $('#totop').click(function(){ $('html ,body').animate({scrolltop: 0}, 300); return false; }); //加载动画 var move = new wow({ boxclass: 'fadeinup', animateclass: 'animated', offset: 0, mobile: true, live: true }); var mover = new wow({ boxclass: 'fadeinright', animateclass: 'animated', offset: 0, mobile: true, live: true }); move.init(); mover.init(); //顶部吸顶 //$('.layui-header').$scrollh('.layui-header',"headbg",); /*右侧客服根据离顶部高度 显示隐藏*/ $(window).scroll(function(){ if($(this).scrolltop() > 100){ $('#gotop').addclass("active"); }else{ $('#gotop').removeclass("active"); } }); });