var ismobile = false, wwidth = 0, wheight = 0, serachbox = jquery(".serachbox"), serachclose = jquery(".serachclose"), serachtop = jquery(".serachtop"), navtop = jquery(".navtop"), navclose = jquery(".navclose"), sidernav = jquery(".sidernav"); $nav = jquery("#nav"), $nava = $nav.find("a"), $navsubnav = $nav.find(".subnav"); function ispage() { wwidth = jquery(window).width(); wheight = jquery(window).height(); if (wwidth <= 1024) { ismobile = true; } else if (wwidth > 1024) { ismobile = false; } }; ispage(); jquery(window).resize(function () { ispage(); }) jquery(function () { $(".serach-txt").keyup(function (event) { var keyvalue = event.which; var vakes = $(this).val(); if (keyvalue == 13) { if (vakes == '' || vakes == '输入关键字') return; window.location = 'search.aspx?keyword=' + encodeuricomponent(vakes); } }); $('.serach-btn').click(function () { var vakes = $(".serach-txt").val(); if (vakes == '' || vakes == '输入关键字') return; window.location = 'search.aspx?keyword=' + encodeuricomponent(vakes); }); jquery(".backtop").bind("click", function () { jquery('html, body').stop().animate({ scrolltop: 0 }, 800, 'easeinoutexpo'); }); jquery(".sidernav").nicescroll({ cursorcolor: "#372308", cursoropacitymax: 1, touchbehavior: false, cursorwidth: "0px", cursorborder: "0", cursorborderradius: "5px" }); if (jquery(".link .wa").length >= 1) { jquery(".link .wa").hover(function () { jquery(this).stop(true, true).children(".wbox").show().animate({ bottom: 30, opacity: 1 }, 350).animate({ bottom: 25 }, 200);; }, function () { jquery(this).children(".wbox").hide().animate({ bottom: 30 }, 200).animate({ bottom: 22, opacity: 0 }, 200); }) }; serachtop.bind("click", function () { if (jquery(this).hasclass("serachtop actice")) { serachbox.slideup(); jquery(this).removeclass("actice"); return true; }; jquery(this).addclass("actice"); serachbox.slidedown(); }); serachclose.bind("click", function () { serachtop.removeclass("actice"); serachbox.slideup(); }); jquery(window).scroll(function () { var windowtop = jquery(window).scrolltop(); if (windowtop > 0) { jquery(".top").addclass("topfix"); jquery(".topbg").stop(false, false).animate({ height: "100%" }, 300); } else { jquery(".topbg").stop(false, false).animate({ height: "0%" }, 300); jquery(".top").removeclass("topfix"); }; if (windowtop > 100) { $(".backtop").stop(false, false).fadein(); } else { $(".backtop").stop(false, false).fadeout(); }; }); navtop.bind("click", function () { if (jquery(this).hasclass("navtop actice")) { sidernav.stop(false, false).animate({ right: -480 }, 400); jquery(this).removeclass("actice"); jquery(".nav li").css({ left: 50, opacity: 0 }); return true; }; jquery(this).addclass("actice"); sidernav.stop(false, false).animate({ right: 0 }, 400); jquery(".nav li").each(function () { $(this).delay($(this).index() * 110).animate({ left: 0, opacity: 1 }); }); }); navclose.bind("click", function () { sidernav.stop(false, false).animate({ right: -480 }, 400); jquery(".nav li").css({ left: 50, opacity: 0 }); navtop.removeclass("actice"); $nava.removeclass("cur"); $navsubnav.stop(false, false).hide(); }); jquery("#nav>li>a").bind("click", function (e) { var stcur = $(this); var stli = $(this).parents("li"); if (stli.find(".subnav").size() > 0) { if (stcur.hasclass("cur")) { stli.find(".subnav").stop(false, false).slideup(); stcur.removeclass("cur"); } else { $nava.removeclass("cur"); $navsubnav.stop(false, false).slideup(); stli.find(".subnav").stop(false, false).slidedown(); stcur.addclass("cur"); e.preventdefault(); } } }); });