// Open the Modal
function openModal() {
document.getElementById('myModal').style.display = "block";
var mainnav = document.getElementsByClassName("hoc clear");
mainnav[slideIndex-1].style.display = "none";
}
// Close the Modal
function closeModal() {
document.getElementById('myModal').style.display = "none";
var mainnav = document.getElementsByClassName("hoc clear");
mainnav[i].style.display = null;
}
现在我的导航栏会停留在图像上方但是当你关闭图像时它会不会删除我给他的样式? 有人可以帮助我吗?
答案 0 :(得分:0)
您可以尝试将.modal
CSS类的z-index更改为更高的数字 - 将其从z-index: 1;
更改为z-index: 9999;
:
.modal {
display: none;
position: fixed;
z-index: 9999;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: black;
}