我正在使用此代码创建两个单独的对话框,但是当我添加第二个代码时,它仅在第一个出现时出现。这是第一个的代码:
function showPopUp(el) {
var cvr = document.getElementById("cover")
var dlg = document.getElementById(el)
cvr.style.display = "block"
dlg.style.display = "block"
if (document.body.style.overflow = "hidden") {
cvr.style.width = "1024"
cvr.style.height = "100%"
}
}
function closePopUp(el) {
var cvr = document.getElementById("cover")
var dlg = document.getElementById(el)
cvr.style.display = "none"
dlg.style.display = "none"
document.body.style.overflowY = "scroll"
}
这是第二个的代码:
function showPopUp2(e12) {
var cvr = document.getElementById("cover2")
var dlg = document.getElementById(el2)
cvr.style.display = "block"
dlg.style.display = "block"
if (document.body.style.overflow = "hidden") {
cvr.style.width = "1024"
cvr.style.height = "100%"
}
}
function closePopUp1(el2) {
var cvr = document.getElementById("cover2")
var dlg = document.getElementById(el2)
cvr.style.display = "none"
dlg.style.display = "none"
document.body.style.overflowY = "scroll"
}
有人可以帮忙吗?