JSはクリックして空白を隠します.

1796 ワード

する ログイン function $(id) { return document.getElementById(id); } var login = document.getElementById("login"); login.onclick = function (event) { $("mask").style.display = "block"; $("show").style.display = "block"; document.body.style.overflow = "hidden"; /* */ var event = event || window.event; if (event && event.stopPropagation()) { event.stopPropagation(); }else { event.cancelBubble = true; } } document.onclick = function (event) { var event = event || window.event; var targetId = event.target ? event.target.id : event.srcElement.id; if (targetId != "show") { $("mask").style.display = "none"; $("show").style.display = "none"; document.body.style.overflow = "visible"; } }