$(function() { phnavxl(); }); function phnavxl() { $(".ys_navph2_menu_btn").click(function() { $(this).toggleclass("act"); $("html").toggleclass("modal-open") $(".ys_navph2_list").toggleclass("act"); $('.ys_navph2_header').stop().toggleclass('on'); }); // 二级 $(".ys_navph2_subnav li").click(function(e) { e.stoppropagation(); var $childs = $(this).find("ul"); if ($childs.length > 0) { $(this).toggleclass("act").siblings().removeclass("act"); $(this).siblings().find("ul").stop().slideup(); $childs.eq(0).stop().slidetoggle(); } }); // 语言选择 $(".ys_navph2_lang_btn1").click(function(){ $(".ys_navph2_lang_modal").addclass("act"); }); // 返回主菜单 $(".ys_navph2_lang_back").click(function(){ $(".ys_navph2_lang_modal").removeclass("act"); }); } $(".ys_navph2_search_btn").click(function (e) { e.stoppropagation(); $(".ys_navph2_modal").stop().slidetoggle(); }); $('.ys_navph2_modal').click(function (e) { e.stoppropagation(); }); $('body,html').click(function(){ $('.ys_navph2_modal').stop().slideup(); }); // 禁止鼠标滑动 (function(window){ var myscrollbar; if(window.myscrollbar){ myscrollbar=window.myscrollbar }; myscrollbar={ $html:$("html"), $body:$("body"), originalbodypad:null, scrollbarwidth:0, hide:function(){ this.checkscrollbar(); this.setscrollbar(); this.$html.css("overflow","hidden"); }, show:function(){ this.$html.removeattr("style"); this.resetscrollbar() }, checkscrollbar:function(){ var fullwindowwidth=window.innerwidth; if(!fullwindowwidth){ var documentelementrect=document.documentelement.getboundingclientrect(); fullwindowwidth=documentelementrect.right-math.abs(documentelementrect.left) } this.bodyisoverflowing=document.body.clientwidth1200){ $('.t_shareli').hover(function () { $(this).find('.t_fuer').slidedown(); $(this).stop().addclass('on'); },function () { $(this).find('.t_fuer').slideup(); $(this).stop().removeclass('on'); }); }else{ $('.t_shareli').click(function (e) { e.stoppropagation(); $(this).siblings('.t_shareli').find('.t_fuer').slideup(); $(this).find('.t_fuer').slidetoggle(); $(this).stop().toggleclass('on'); }); $("body").click(function () { $(".t_fuer").stop().slideup(); $('.t_shareli').stop().removeclass('on'); }) } // 在线购买 $('.t_navgou').hover(function (e) { e.stoppropagation(); $(this).stop().toggleclass('on'); // $(this).find('.t_gouxia').stop().slidetoggle(); $(".t_head").addclass("on"); },function () { $(".t_navgou").stop().removeclass('on'); // $(".t_gouxia").stop().slideup(); // if ($(window).scrolltop() <= 0){ // $(".t_head").removeclass("on"); // } }); // $("body").click(function () { // $(".t_navgou").stop().removeclass('on'); // $(".t_gouxia").stop().slideup(); // }); $('.t_gouli').click(function () { $(this).stop().addclass('on'); $(this).siblings().stop().removeclass('on'); // var cheng = $(this).find('.t_waizi').text(); // $('.t_zaimai').stop().text(cheng); }); if($('.t_head').hasclass('t_neihead2')){ $(window).scroll(function () { // if ($(window).scrolltop() > 0) { // $(".t_head").removeclass("t_syheadbai"); // $(".t_head").addclass("on"); // } else { // $(".t_head").addclass("t_syheadbai"); // $(".t_head").removeclass("on"); // } }); // $('.t_head').hover(function () { // $(".t_head").removeclass("t_syheadbai"); // $(".t_head").addclass("on"); // },function () { // if ($(window).scrolltop() <= 0){ // $(".t_head").addclass("t_syheadbai"); // $(".t_head").removeclass("on"); // } // }); $('.t_headlogo,.t_navfr ').hover(function () { $(".t_head").removeclass("t_syheadbai"); $(".t_head").addclass("on"); },function () { // if ($(window).scrolltop() <= 0){ // $(".t_head").addclass("t_syheadbai"); // $(".t_head").removeclass("on"); // } }); } // 鼠标滑动样式对应改变 function asidenav() { for(var i = 0;i< $('.t_b1mao').length;i++){ if($(window).width() > 950){ var tops = $('.t_b1mao[data-num="' + i + '"]').offset().top - 89; }else{ tops = $('.t_b1mao[data-num="' + i + '"]').offset().top - 74; } if($(window).scrolltop() > tops){ $('.t_b1mao').siblings('.t_b1mao').stop().removeclass('act_nr'); $('.t_b1mao[data-num="' + i + '"]').stop().addclass('act_nr'); $('.t_erli').siblings('.t_erli').stop().removeclass('on'); $('.t_erli[data-num="' + i + '"]').stop().addclass('on'); } } } // 点击滑动,锚点定位切换 function achange1() { $(".t_erli").click(function () { settimeout(function () { $("html,body").stop().animate({ scrolltop: $('.act_nr').offset().top - 80 }, 500); }, 100) }) // 产品数据切换pc $('.t_erli').click(function () { var pag = $(this).attr('data-num'); $('.t_b1mao').siblings('.t_b1mao').stop().removeclass('act_nr'); $('.t_b1mao[data-num="' + pag + '"]').stop().addclass('act_nr'); $(this).stop().addclass('on'); $(this).siblings().stop().removeclass('on'); }); } // 点击滑动,锚点定位切换 function achange() { $(".t_c1li").click(function () { settimeout(function () { $("html,body").stop().animate({ scrolltop: $('.act_nr').offset().top - 60 }, 500); }, 100) }) // 产品数据切换pc $('.t_c1li').click(function () { var pag = $(this).attr('data-num'); $('.t_c1k2li').siblings('.t_c1k2li').stop().removeclass('act_nr'); $('.t_c1k2li[data-num="' + pag + '"]').stop().addclass('act_nr'); $(this).stop().addclass('on'); $(this).siblings().stop().removeclass('on'); dianxian(); }); } // 鼠标滑动样式对应改变 function asidenav1() { for(var i = 0;i< $('.t_c1k2li').length;i++){ if($(window).width() > 950){ var tops = $('.t_c1k2li[data-num="' + i + '"]').offset().top - 79; }else{ tops = $('.t_c1k2li[data-num="' + i + '"]').offset().top - 64; } if($(window).scrolltop() > tops){ $('.t_c1k2li').siblings('.t_c1k2li').stop().removeclass('act_nr'); $('.t_c1k2li[data-num="' + i + '"]').stop().addclass('act_nr'); $('.t_c1li').siblings('.t_c1li').stop().removeclass('on'); $('.t_c1li[data-num="' + i + '"]').stop().addclass('on'); dianxian(); } } } function dianxian() { var gao = $('.t_c1ul').height() / $('.t_c1li').length; var shu = $('.t_c1li.on').stop().attr('data-num'); $('.t_cexian').css('top',gao*shu+'px'); } // 微动 function mouse1() { $(window).mousewheel(function(event){ if(event.deltay == 1){ $('.t_weidong').stop().removeclass('on'); $('.t_weidong').stop().addclass('act'); }else if(event.deltay == -1){ $('.t_weidong').stop().addclass('on'); $('.t_weidong').stop().removeclass('act'); } }); } function mouse2() { $(window).mousewheel(function(event){ if(event.deltay == -1){ $('.t_weidong').stop().removeclass('on'); $('.t_weidong').stop().addclass('act'); }else{ $('.t_weidong').stop().removeclass('act'); } }); } // 载入 var animatedh = $(".t_neilv"); $(window).bind('scroll load',function(){ var pmw=window.innerwidth, pmh=window.innerheight; var scrolltop = $(window).scrolltop()+pmh; if(animatedh.length>0){ animatedh.each(function(i) { var animatetop = $(this).offset().top+60; if (scrolltop > animatetop) { $(this).addclass("on"); }else{ $(this).removeclass("on"); } }); } }); $(window).scroll(function () { if($(window).width()>1024){ if($('.t_ernav').css('position') == "fixed"){ $('.t_ernav').stop().addclass('on'); }else{ $('.t_ernav').stop().removeclass('on'); } } if($(window).width()>1920){ var celeft = ($(window).width() - 1920) /2; $('.t_c1ce.on').stop().css('left',celeft + 72); } }); if($(window).width()>1920){ var celeft = ($(window).width() - 1920) /2; var toprg = celeft + 66; $('.t_cebian').stop().css('right',toprg); $('.t_c1ce.on').stop().css('left',celeft + 72); } // 导航 $('.t_navli').hover(function (e) { e.stoppropagation(); if($(this).stop().attr('data-num')){ var shu = $(this).stop().attr('data-num'); $('.t_naverzo[data-num='+shu+']').stop().addclass('on'); $('.t_naverzo[data-num='+shu+']').siblings('.t_naverzo').stop().removeclass('on'); var kuan =$('.t_naverzo[data-num='+shu+']').width(); var gao = $('.t_naverzo[data-num='+shu+']').height(); $('.t_navtuxia').stop().css('width',kuan); $('.t_navtuxia').stop().css('height',gao); } },function(){ $('.t_navtuxia').stop().css('width',0); $('.t_navtuxia').stop().css('height',0); $('.t_naverzo').stop().removeclass('on'); }); $('.t_naverzo').hover(function(e){ e.stoppropagation(); $(this).stop().addclass('on'); var kuan =$(this).width(); var gao = $(this).height(); $('.t_navtuxia').stop().css('width',kuan); $('.t_navtuxia').stop().css('height',gao); },function(){ $('.t_navtuxia').stop().css('width',0); $('.t_navtuxia').stop().css('height',0); $('.t_naverzo').stop().removeclass('on'); }); // $('.t_head').hover(function () { // $(this).stop().addclass('on'); // },function () { // $(this).stop().removeclass('on'); // });