if (typeof $ != "undefined") { ; $(function() { var width = $(window).width(); var win = $(window); var isie = !!window.activexobject; var isie6 = isie && !window.xmlhttprequest; var isie8 = isie && !!document.documentmode; var isie7 = isie && !isie6 && !isie8; // funhead if (width > 800) { (function() { var win = $(window); var header = $("#header"); if (header.length > 0 && header.hasclass("tofixed")) { var headertop = header.offset().top, headerheight = header.height(), headerfixedtop = headertop + headerheight; var headerwrap = $("#headerwrap"); headerwrap.length > 0 ? function() { headerwrap.height(headerheight); }() : 0; win.on("load scroll resize", function() { $(this).scrolltop() >= headerfixedtop ? function() { !header.hasclass("header_fixed") ? header.addclass("header_fixed") : 0; }() : function() { header.removeclass("header_fixed") }(); if (isie6) { var scrollt = $(this).scrolltop(); scrollt >= headerfixedtop ? function() { header.css({ "top": scrollt + "px" }); }() : function() { header.css({ "top": "0px" }); }(); }; }); }; })(); } // end funhead // ftool (function() { var ftool = $("#ftool"), ftooltop = $("#ftooltop"); ftooltop.click(function(e) { e.preventdefault(); $("html,body").animate({ scrolltop: 0 }, 500); }); $(window).on("domcontentloaded scroll resize", function() { $(this).scrolltop() == 0 ? ftooltop.stop(true, true).fadeout() : ftooltop.fadein(); $(this).scrolltop() < 320 ? ftool.stop(true, true).fadeout() : ftool.fadein(); }); // ie6 if (isie6) { $(window).scroll(function() { $("#ftool").css({ "top": $(this).scrolltop() + 200 }); }); }; })(); // end ftool }); }; // end jq document.addeventlistener("touchstart", function() {}, true); var $$ = document.queryselectorall.bind(document); element.prototype.on = element.prototype.addeventlistener; element.prototype.off = element.prototype.removeeventlistener; var foreach = function(array, fn) { [].foreach.call(array, fn); }; function disablescroll(e) { e.preventdefault(); } // slide if (typeof touchslide == "function") { touchslide({ slidecell: "#focusvideo", maincell: ".bd", effect: "leftloop", autoplay: true, delaytime: 500, intertime: 5000 }); }; // end slide document.addeventlistener("domcontentloaded", function() { }); function callsidemenu() { var $$html = document.queryselector("html"); var sidemenu = document.getelementbyid("sidemenu"); if ($$html.classlist.contains("show_sidemenu")) { $$html.classlist.remove("show_sidemenu"); $$html.off("touchmove", disablescroll); } else { $$html.classlist.add("show_sidemenu"); $$html.on("touchmove", disablescroll); sidemenu ? sidemenu.on("touchmove", function(e) { e.stoppropagation() }) : 0; } } function hidesidemenu() { var $$html = document.queryselector("html"); $$html.classlist.remove("show_sidemenu"); $$html.off("touchmove", disablescroll); } var width = $(window).width(); $(function() { $('#phone_show').click(function() { $('.erji_show').slidetoggle(); }); });