window.onload = function() { // 头部展开按钮 $('.menu').click(function() { console.log(11) $('.shouji_header').css('right', '0') $('.zhezhao').css('display', 'block') }) // 产品中心头部 $('.header_chanpin_tab a').click(function(){ var index = $(this).index() $(this).addclass('header_chanpin_tab_hover').siblings().removeclass('header_chanpin_tab_hover') $('.header_chanpin_main_box .header_chanpin_main').eq(index).addclass('header_chanpin_main_btn').siblings().removeclass('header_chanpin_main_btn') }) // 遮罩 $('.zhezhao').click(function() { $('.shouji_header').css('right', '-300px') $(this).css('display', 'none') $('.menu').attr('class', 'menu') }) // 手机二级 var a = null; $('.shouji_header_li a').click(function() { // 获取点击的index值 var index = $(this).parents('li').index() if (a == index) { $(this).children('img').removeclass('rotate90') $(this).next().slideup() a = null } else { $(this).children('img').addclass('rotate90').parents('li').siblings().children('a').children('img') .removeclass('rotate90'); $(this).next().slidedown() $(this).parents('li').siblings().children('ul').slideup() a = index } }) // 内页com头部 $('.neiye_header_tab li').click(function() { $(this).children('a').addclass('neiye_header_tab_btn').parent('li').siblings().children('a').removeclass('neiye_header_tab_btn') }) // 产品中心侧边栏 $('.zhongxin_list_ul li').mouseenter(function(){ $(this).addclass('zhongxin_list_ulbtn').siblings().removeclass('zhongxin_list_ulbtn') $(this).children('ul').addclass('zhongxin_list_erji_btn').parent('li').siblings().children('ul').removeclass('zhongxin_list_erji_btn') }) $('.zhongxin_list_erji li').mouseenter(function(){ $(this).addclass('zhongxin_list_erjibtn').siblings().removeclass('zhongxin_list_erjibtn') }) } // 滚动动画 function ani2(claname,children,type1,type2){ $(window).scroll(function sroll() { if(($(claname).offset().top - $(window).scrolltop()) < $(window).height() - 100){ tiem = 200 settimeout(function(){ $(claname).children(children).removeclass(type2).addclass('animate__animated ' + type1); },tiem) } else { settimeout(function(){ $(claname).children(children).removeclass(type1).addclass('animate__animated ' + type2); },200) } }); }; // 滚动动画 aos.init({ easing: 'ease-out-back', duration: 2000, offset: 100, });