日期:2014-05-16  浏览次数:20352 次

怎样设置透明遮盖层下面的东西不能点击?
怎样设置透明遮盖层下面的东西不能点击?
HTML code

<body>
    <style type="text/css">
        *{padding:0;margin:0;}
        body{padding:20px;}
        .overlay{
            position:absolute;
            width:500px;
            height:500px;
            border:1px solid red;
            z-index:100;
        }
    </style>
    <div class="overlay"></div>
    <a href="javascript:;" onclick="alert('hello')">hello</a>
</body>




------解决方案--------------------
额 那样改了火狐又不起作用了
style="opacity:0.0;filter:alpha(opacity=0);"
改成这样看看行不行
------解决方案--------------------
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=utf8" />

 <style>
*{padding:0;margin:0;}
body{padding:20px;}
.overlay{position:absolute;width:500px;height:500px;border:1px solid red;z-index:100;display:none;}
 </style>

</head>

<body>

<div class="overlay" id="over"></div>
<a href="javascript:;" onclick="change()">hello</a>
<script>
function change()
{
document.getElementById('over').style.display="block";
}
</script>
</body>

</html>