我有一个链接,一旦点击就会显示弹出窗口。
<div id="popup1" class="overlay">
<div class="popup">
<h2>Contact</h2>
<a class="close" href="#">×</a>
<div class="content">
Stuff in popup.
</div>
</div>
</div>
点击链接后,叠加层会显示弹出窗口。
DIV
.box {
width: 50%;
margin: 0 auto;
background: rgba(255,255,255,0.2);
padding: 35px;
border: 2px solid #fff;
border-radius: 20px/50px;
background-clip: padding-box;
text-align: center;
}
.button {
transition: all 0.3s ease-out;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.7);
transition: opacity 500ms;
visibility: hidden;
opacity: 0;
}
.overlay:target {
visibility: visible;
opacity: 1;
}
.popup {
margin: 70px auto;
padding: 20px;
background: #fff;
border-radius: 5px;
width: 50%;
height: 50%;
position: relative;
}
.popup h2 {
margin-top: 0;
color: #333;
font-family: Tahoma, Arial, sans-serif;
}
.popup .close {
position: absolute;
top: 20px;
right: 30px;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #333;
}
.popup .content {
max-height: 100%;
overflow: auto;
}
CSS
cabal install gloss-examples
我的问题是,当弹出窗口可见时,我仍然可以点击叠加层并点击我的div容器中的其他链接。 有没有办法设置“指针事件:无;”只要我的弹出窗口可见,就应用于div id =“container”?
答案 0 :(得分:1)