var isMobile=false; $(function(){ $(".header .navbox li").each(function(){ if($(this).find(".subnav").children("a").length=""){ $(this).find(".subnav").hide(); } }) // 涓€绾у鑸紶鏍囨粦杩囧嚭鐜颁笅鎷 $(".header .navbox li").hover(function () { $(this).find(".subnav").slideDown("slow"); if($(this).find(".subnav").find("a").length==""){ $(this).find(".subnav").hide(); }else{ $(this).children("a").addClass('hover'); } }, function () { $(this).find(".subnav").stop(true, false).slideUp(); if($(this).find(".subnav").find("a").length==""){ $(this).find(".subnav").hide(); }else{ $(this).children("a").removeClass('hover'); } }) // 鎵嬫満瀵艰埅 $(".mc_phone_nav").click(function () { $(".mobile").toggleClass("active"); $(this).find(".point").toggleClass("active"); }); $(".mobilebox h4").click(function () { if ($(this).parents("li").hasClass("mc_phnav_hasnosub")) { return; } $(this).siblings(".ul2").stop().slideToggle(); $(this).parent().parent().siblings().find(".ul2").stop().slideUp(); $(this).toggleClass("active"); $(this).parent().parent().siblings().find("h4").removeClass('active'); }); $(".ul1>li").each(function () { if ($(this).find(".ul2 li").length == 0) { $(this).addClass("mc_phnav_hasnosub"); } }) setScreenBox(); $(window).resize(function(){ setScreenBox(); }) $(".pages a:first").hide(); $(".index-about ul li:last").css("marginRight",'0'); $(".index-news-right li:last").css("borderBottom","none"); $(".about-item:nth-child(odd)").addClass("fr"); $('.animate').scrolla({ mobile:false, once:true }); $(".newsnav a:last").addClass("active"); }) function scrollact(e,fix,fncome){ var h=0; if(!fncome){fncome=function(){};} //if(!fnback){fnback=function(){};} if($(e).length>0){ if(!fix && fix!=0){fix=1;} fix=$(window).height()*fix*0.1; if($(window).scrollTop()+fix+h>=$(e).offset().top){ if(!$(e).hasClass("showdiv")){ $(e).addClass("showdiv"); fncome(); } } } } function setScreenBox(){ if($(window).width()>768){ $(".index-product-list li").each(function(){ var index = $(this).index(); $(this).addClass("index"+index); }) $(".productlist li").each(function(){ if($(this).index()%3==2){ $(this).css("marginRight","0"); } }) $(".product-list li").each(function(){ if($(this).index()%4==3){ $(this).css("marginRight","0"); } }) } if($(window).width()<768){ $(".index-about ul li:nth-child(even),.productlist li:nth-child(even)").css("marginRight","0") } } function RQ(pVar, pURL) { pURL = pURL || window.location.href; try { pURL = decodeURIComponent(pURL) } catch (e) { } var paraString = pURL.substring(pURL.indexOf("?") + 1, pURL.length).split("&"); var paraObj = {} for (i = 0; j = paraString[i]; i++) { paraObj[j.substring(0, j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=") + 1, j.length); } var returnValue = paraObj[pVar.toLowerCase()]; if (typeof (returnValue) == "undefined") { return ""; } else { return returnValue; } }