$(".topbar-icon").on("click", function () { $("body").toggleClass("topbar-show") }), $(".mask").on("click", function () { $("body").removeClass("topbar-show") }), $(function () { function a() { var d, a = navigator.userAgent, b = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"], c = !1; for (d = 0; d < b.length; d++) if (a.indexOf(b[d]) > 0) { c = !0; break } return c } a() && $("#scrollbar").hide(), function () { var a = $(document).scrollTop(), b = $(window).height(), c = $(".header"), d = $("#scrolltop"); 0 == a && (d.hide(), c.addClass("enlarge")), $(window).scroll(function () { a = $(document).scrollTop(), b > a ? d.hide() : d.show(), 5 >= a ? c.addClass("enlarge") : c.removeClass("enlarge") }) }(), $("#scrolltop").on("click", function () { $("body,html").stop().animate({ scrollTop: "0px" }, 500) }), $("#scrollbar >ul>li").each(function () { $(this).hover(function () { $(this).find(".scroll-hover").toggle() }) }), $(".dropdown").each(function () { var a = null, b = $(this); b.hover(function () { b.addClass("open active"), clearTimeout(a) }, function () { a = setTimeout(function () { b.removeClass("open active") }, 200) }) }) });