12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- $(document).ready(function () {
- const VAPES_AGEREMINDER = "vapes_ageReminder"
- //用户存储token名
- const VAPES_TOKEN = "vapes_token"
- //菜单按钮
- const mobileMenuBot = $('#mobileMenuBot');
- //触屏事件 || 点击事件
- const tap = "ontouchstart" in window ? "touchstart" : "click";
- if ($.fn.lazyload) {
- $("img.lazy").lazyload();
- }
- const initMainHeight = () => {
- setTimeout(() => {
- const browserHeight = $(window).height();
- const headerHeight = $("#headerContainer").height();
- const footerHeight = $("#footerContainer").height();
- $('#main').css('min-height', browserHeight - headerHeight - footerHeight);
- }, 0)
- }
- /**
- * 年龄提示方法
- */
- function ageReminderMethod() {
- const ageReminder = localStorage.getItem(VAPES_AGEREMINDER);
- const maskElement = $(".maskContainer");
- if (!ageReminder) {
- maskElement.show(0)
- } else {
- maskElement.hide(0)
- }
- }
- /**
- * 手机端菜单展开收起
- */
- function starSlideToggle() {
- $(".mobileMenuFixed").stop().slideToggle(80);
- if (mobileMenuBot.hasClass('open')) {
- mobileMenuBot.removeClass('open');
- } else {
- mobileMenuBot.addClass('open');
- }
- }
- /**
- * 年龄提示 NO 点击
- */
- $(".ageReminderNo").on(tap, function () {
- window.close()
- history.back();
- });
- /**
- * 年龄提示 Yes 点击
- */
- $(".ageReminderYes").on(tap, function () {
- localStorage.setItem(VAPES_AGEREMINDER, "1");
- $(".maskContainer").hide(0)
- });
- /**
- * 手机端菜单绑定事件
- */
- mobileMenuBot.on('tap', starSlideToggle)
- ageReminderMethod()
- initMainHeight()
- })
|