$(function () { $(".guanb").click(function(){ $(".dibuduxuf").hide(); }); var $Btn = $("header .phonebtn"), $Nav = $("header .h-right > ul"), t=1; $(window).resize(Width); Width(); function Width() { if ($(window).width() < 1470) { $Btn.click(function () { if (t==1){ $Nav.css("right",0); t=2; } else { $Nav.css("right",-200 + "px"); t=1; } }); /* $Btn.mouseleave(function () { }); $Nav.mouseenter(function () { $(this).css("right",0); }); $Nav.mouseleave(function () { $(this).css("right",-200+"px") ; });*/ } } (function () { var $I = $("header .h-right > ul > li i"), $mNav = $("header .h-right > ul > li .mnav"); $(window).resize(f); f(); function f() { if ($(window).width() < 700){ $I.mouseenter(function () { $(this).parent().css("height","auto"); $(this).next(".mnav").stop().slideToggle(500); }); $I.mouseleave(function () { $(this).next(".mnav").stop().slideToggle(500); setTimeout(function () { $I.parent().css("height","45px"); },600); }) } } })(); (function () { var $Nul = $("#top-pic .nav ul"), $Nli = $Nul.find("li"); $(window).resize(navWidth); navWidth(); function navWidth() { if ($(window).width() < 500) { $Nul.css("width", $Nli.eq(1).outerWidth(true) * $Nli.length + 20 + "px"); } } })(); (function () { $(window).resize(footerHight); footerHight(); function footerHight() { if ($(window).width()<800){ console.log(1); var $fLi = $("footer .nav > li"); var arr=[]; var str; var len =$fLi.length; for (var i = 0; i < len ;i++){ str = $fLi.eq(i).height(); arr.push(str); } function compare(val1,val2){ return val1-val2; }; var Array= arr.sort(compare); $fLi.css("height",Array[len-1]+"px"); } } })(); (function () { $("footer #contact .right ul li:nth-child(2)").hover(function () { $("footer #contact .right > img:nth-of-type(1)").stop().fadeOut(500); $("footer #contact .right > img:nth-of-type(2)").stop().fadeIn(500); },function () { $("footer #contact .right > img:nth-of-type(2)").stop().fadeOut(500); $("footer #contact .right > img:nth-of-type(1)").stop().fadeIn(500); }); })(); });