<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS:pointer-events</title>
<style type="text/css">
    .overlay1 {
        width:80px;
        height:20px;
        background:gold;
        position:absolute;
        top:5px;
        left:5px;
        opacity:0.5;
    }
    .overlay2 {
        width:80px;
        height:20px;
        background:gold;
        position:absolute;
        top:40px;
        left:5px;
        opacity:0.5;
    }
    .pointer{pointer-events:none;}
</style>
<script type="text/javascript">
window.onload = function(){
    document.getElementById('chx').onclick = function(){
        document.getElementById('a').className 
            = "overlay1 " + ((this.checked)? "pointer" : "");
        document.getElementById('b').className 
            = "overlay2 " + ((this.checked)? "pointer" : "");
    }
}
</script>
</head>
<body>
    <div ></div>
    <div ></div>
    <a href="http://mail.sina.com.cn">SinaMail</a>
    <br/><br/>
    <span onclick="alert(3);">SinaMail</span>
    <p>
        <input >
        <label for="chx">开启穿透点击</label>
    </p>
</body>
</html>

http://www.cnblogs.com/snandy/archive/2011/03/17/1986807.html

相关文章:

  • 2022-12-23
  • 2021-06-27
  • 2021-07-20
  • 2021-10-03
  • 2021-09-08
  • 2021-05-21
  • 2022-12-23
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2021-12-02
  • 2022-12-23
相关资源
相似解决方案