关闭按钮逻辑修改

This commit is contained in:
谢宇宁
2026-10-29 20:19:55 +07:00
parent bfc26aa5ab
commit 46ebf7de2e
2 changed files with 7 additions and 6 deletions
+5 -4
View File
@@ -47,11 +47,12 @@
} }
} }
var confirmBtn = mask.querySelector("[data-eight-pop-confirm]"); // 确认按钮和右下角关闭按钮(X)都视为确认年龄并进入网站。
var confirmBtns = mask.querySelectorAll("[data-eight-pop-confirm]");
var exitBtns = mask.querySelectorAll("[data-eight-pop-exit]"); var exitBtns = mask.querySelectorAll("[data-eight-pop-exit]");
if (confirmBtn) { confirmBtns.forEach(function (button) {
confirmBtn.addEventListener("click", confirmAge); button.addEventListener("click", confirmAge);
} });
exitBtns.forEach(function (button) { exitBtns.forEach(function (button) {
button.addEventListener("click", exitSite); button.addEventListener("click", exitSite);
}); });
+2 -2
View File
@@ -13,10 +13,10 @@
<button class="eight-pop-btn eight-pop-btn--exit" type="button" data-eight-pop-exit>我未满18岁-退出</button> <button class="eight-pop-btn eight-pop-btn--exit" type="button" data-eight-pop-exit>我未满18岁-退出</button>
</div> </div>
</div> </div>
<button class="eight-pop-close" type="button" data-eight-pop-exit aria-label="关闭并退出访问"> <button class="eight-pop-close" type="button" data-eight-pop-confirm aria-label="关闭并进入网站">
<img src="/static/images/figma-age/close.svg" width="36" height="36" alt="" /> <img src="/static/images/figma-age/close.svg" width="36" height="36" alt="" />
</button> </button>
</div> </div>
</div> </div>
<script src="/static/js/pages/eightPop.js?v=4"></script> <script src="/static/js/pages/eightPop.js?v=5"></script>
{{end}} {{end}}