1
我已经设置了一个小提琴来演示我正在尝试做什么。显示/隐藏全屏覆盖
http://jsfiddle.net/AndyMP/nNUkr/
全屏幕叠加显示,但它并没有消失,因为我希望它(点击时)。
<div id="fullscreen" class="fullscreen_hide"></div>
<div id="button" class="button"></div>
CSS
.button{
position:absolute;
z-index:2000;
height:100px;
width:200px;
background:red;
float:left;
}
.fullscreen_hide{
position:absolute;
z-index:1000;
opacity:0;
top:0;
bottom:0;
right:0;
left:0;
background:#141414;
}
.fullscreen_show{
position:absolute;
z-index:3000;
opacity:1;
top:0;
bottom:0;
right:0;
left:0;
background:#141414;
}
代码
$('.button').click(function(){
$(this).siblings().addClass('fullscreen_show');
});
$('.fullscreen_show').click(function(){
$(this).siblings().removeClass('fullscreen_show');
});
感谢您的解释。也有助于深入了解代码。 – Andy