2 つの div があり、1 つが別の上に重ねられています。外側の div をクリックすると、内側の div が非表示になります。内側の div をクリックしても、内側の Div には何も起こらないはずです。同時に、内側の div のリンクは正常に機能するはずです。jqueryを使用してそれを行う方法は?
<div class="outer">
<div class="inner"></div>
</div>
.outer {
background-color: #000;
position: fixed;
top: 0;
left: 0;
z-index: 9998;
height: 100%;
width: 100%;
opacity: 0.5;
}
.inner {
background-color: blue;
width: 240px;
position: fixed;
z-index: 9999;
left: 50%;
top: 50%;
margin-left: -300px;
margin-top: -150px;
}
期待どおりに動作しない jQuery コード:
$('.outer').click(function(e){
$('.inner').hide();
});
$('.inner').click(function(e){
return false;
});