); }, 400); $(window).on("resize", function() { moveAdToDescription(); checkShowMoreButtons(); checkSwiperOverflow(); }); // 禁止fixed元素滚动 document.getElementsByClassName("fixed")[0].addEventListener("touchmove", function(e) { e.preventDefault(); e.stopPropagation(); }, false); // 轮播图初始化 var swiper = new Swiper('.shot-pan', { slidesPerView: 'auto', spaceBetween: 8, nextButton: '.shot-pan .swiper-button-next', prevButton: '.shot-pan .swiper-button-prev' }); $("img.swiper-load").load(function () { swiper.init(); setTimeout(checkSwiperOverflow, 100); }); $(".desc-show-more").on("click", function() { var $btn = $(this); var $section = $btn.closest(".section-desc"); setDescriptionState($section, $btn, $section.hasClass("limit-height")); }); $(".nav-list-icon").on("click",function () { if ($(this).hasClass("active")) { $(".more-language").css("display","none"); $(this).removeClass("active"); } else { $(".more-language").css("display","block"); $(this).addClass("active"); } }); $("body").click(function(e) { if ($(e.target).hasClass("nav-list-icon") || $(e.target).parent().hasClass("nav-list-icon")) { return; } if ($(".nav-list-icon").hasClass("active")) { $(".more-language").css("display","none"); $(".nav-list-icon").removeClass("active"); } }); $(".more-language").on("click","a",function () { var exp = new Date(); exp.setFullYear(exp.getFullYear()+100); var preferred_lang = $(this).attr("data-lang"); if (preferred_lang == "cn") return; document.cookie = "preferred_lang="+preferred_lang+";path=/;domain=.memuplay.com;expires=" + exp.toGMTString(); }); })