", { id: sideMenu.vars.selector.replace("#", ""), class: "touch-scroll", html: $("nav ul", "#top").html() })); $("a", sideMenu.vars.selector).removeClass("btn"); } $(sideMenu.vars.selector).css({ width: sideMenu.vars.size, marginRight: "-" + sideMenu.vars.size }).animate({ marginRight: 0 }, 300, "easeOutExpo"); $("body").data("menu-open", true).css({ position: "fixed", overflow: "hidden", width: "100%" }).animate({ left: "-" + sideMenu.vars.size }, 300, "easeOutExpo"); }, close: function() { $(sideMenu.vars.selector).animate({ marginRight: "-" + sideMenu.vars.size }, 300, "easeOutExpo"); $("body").data("menu-open", false).animate({ left: 0 }, 300, "easeOutExpo", function() { $(this).css({ position: "", overflow: "" }); }); } }; $(document).on("click", "#side-menu a", function() { $("body").css({ position: "", overflow: "" }); $(sideMenu.vars.selector).hide(); }); var $preFoot = $("#pre-foot"), $footer = $("footer"), scrollFollow = function() { var height = $(window).height(), scrollTop = $(window).scrollTop(), animation_time = $preFoot.is(":animated") ? 0 : 200; if (PF.fn.isDevice(["phone", "phablet"])) { $preFoot.removeClass("absolute fixed"); $footer.css("marginTop", ""); return; } else { $footer.css("marginTop", $preFoot.outerHeight(true)); } if (scrollTop > height / 2) { if (scrollTop + height > $footer.offset().top) { $preFoot.addClass("absolute").removeClass("fixed").css({ top: "", bottom: "" }); } else { if ($preFoot.css("position") == "fixed") return; $preFoot.removeClass("absolute").addClass("fixed").css({ top: "auto", bottom: -$preFoot.outerHeight(true) }); $preFoot.animate({ bottom: 0 }, animation_time); $footer.css("marginTop", $preFoot.outerHeight(true)); } } else { if ($preFoot.css("position") !== "fixed") return; $preFoot.animate({ bottom: -$preFoot.height() }, animation_time, function() { $preFoot.removeClass("absolute fixed"); }); } }; $footer.css("marginTop", $preFoot.outerHeight(true)); scrollFollow(); $(window).on("scroll resize", function() { scrollFollow(); }); $("#cover-arrow-down, #call-to-action").click(function(e) { e.preventDefault(); $("html,body").animate({ scrollTop: $(".background-cover").height() }); }); $(document).on("submit", "form#newsletter-signup-form", function(e) { e.preventDefault(); var $this = $(this), $email = $("#newsletter-form-email", this) $button = $("#newsletter-form-submit", this); $this.disableForm(); $button.removeClass('red').addClass('grey'); $button.find(".text").css("visibility", "hidden"); PF.fn.loading.inline($(".loading", $this), { size: "small", center: true, }); var newsletterXHR = $.ajax({ data: { action: "newsletter-subscribe", email: $email.val(), list: "newsletter" } }).complete(function(XHR) { $this.enableForm(); $(".loading", $this).empty(); $button.find(".text").css("visibility", ""); $button.removeClass('grey').addClass('red'); var response = XHR.responseJSON; PF.fn.growl.call(response.status == 200 ? response.success.message : response.error.message); if (response.status == 200) { $this[0].reset(); $("#pre-foot").fadeOut(function() { $(this).remove(); }); } }); }); if ($("#home-cover").exists()) { var landing_src = $(".home-cover-img", "#home-cover-slideshow").first().attr("data-src"); function showHomeCover() { $("body").addClass("load"); $(".home-cover-img", "#home-cover-slideshow").first().css("background-image", "url(" + landing_src + ")").addClass("animate-in--alt").removeAttr("data-src"); setTimeout(function() { $("body").addClass("loaded"); setTimeout(function() { showHomeSlideshow(); }, 7000); }, 400 * 1.5); } var showHomeSlideshowInterval = function() { setTimeout(function() { showHomeSlideshow(); }, 8000); }; function showHomeSlideshow() { var $image = $(".home-cover-img[data-src]", "#home-cover-slideshow").first(); var $images = $(".home-cover-img", "#home-cover-slideshow"); if ($image.length == 0) { if ($images.length == 1) return; $images.first().removeClass("animate-in"); $("#home-cover-slideshow").append($images.first()); setTimeout(function() { $(".home-cover-img:last", "#home-cover-slideshow").addClass("animate-in"); }, 20); setTimeout(function() { $(".home-cover-img:not(:last)", "#home-cover-slideshow").removeClass("animate-in"); }, 4000); showHomeSlideshowInterval(); } else { var src = $image.attr("data-src"); $("").attr("src", src) .on("load error", function() { $(this).remove(); $image.css("background-image", "url(" + src + ")").addClass("animate-in").removeAttr("data-src"); setTimeout(function() { $(".home-cover-img:not(:last)", "#home-cover-slideshow").removeClass("animate-end animate-in--alt"); }, 2000); showHomeSlideshowInterval(); }); } } if (landing_src) { $("").attr("src", landing_src) .on("load error", function() { $(this).remove(); showHomeCover(); }); } else { showHomeCover(); } } }); 最新亚洲中文字幕一区在线_中文字幕大香视频蕉免费_中文字幕乱码高清完整版