ux: 点击模态框外部区域自动关闭

This commit is contained in:
2026-04-16 12:14:01 +08:00
parent 57dd733f67
commit 768b582db9

View File

@@ -8,6 +8,15 @@ var refreshTimer = null;
document.addEventListener('DOMContentLoaded', function() {
loadConfig();
refreshAll();
// 点击模态框背景关闭
document.querySelectorAll('.modal').forEach(function(modal) {
modal.addEventListener('click', function(e) {
if (e.target === modal) {
modal.classList.remove('active');
}
});
});
});
function loadConfig() {