/** * @Description: 【官网】金胜维 * @Author: MaXueWei * @Date: 2023-11-28 15:48:19 * @LastEditors: MaXueWei * @LastEditTime: 2023-12-1 11:46:12 */ $(function () { // 初始化 AOS AOS && AOS.init({ duration: 1000 }); }); // ==================== 通用弹窗 Start ==================== /** * 通用弹窗 * @param {*} btnEl 传入打开弹窗的按钮的id * @param {*} popupEl 传入弹窗的容器的id */ function commonPopup(btnEl, popupEl) { this.btnEl = btnEl this.popupEl = popupEl } commonPopup.prototype.init = function () { const that = this $(that.btnEl).on("click", function () { $(that.popupEl).show(); setTimeout(() => { $(that.popupEl).animate({ scrollTop: 0 }, 10) $(that.popupEl).addClass("active") $('html').addClass("no-scroll") }, 10) }) $(that.popupEl).find(".close").on("click", function () { $(that.popupEl).removeClass("active") setTimeout(() => { $(that.popupEl).hide(); $('html').removeClass("no-scroll") }, 500) }) $(that.popupEl).on("click", function () { $(that.popupEl).removeClass("active") setTimeout(() => { $(that.popupEl).hide(); $('html').removeClass("no-scroll") }, 500) }) $(that.popupEl).find(".popup-box").on("click", function (e) { e.stopPropagation(); }) } // ==================== 通用弹窗 End ==================== // ==================== 页面更新中敬请期待 Start ==================== $(".alter-btn").on("click",function(){ alert("内容正在更新中,敬请期待!") }) // ==================== 页面更新中敬请期待 End ====================