简单易用兼容IE6的Jquery遮盖层和弹框

<!doctype html>
<html lang="en">
<head>
  <title>遮罩层效果 兼容ie firefox jQuery遮罩层</title>
  <meta name="keywords"  content="你好好 " />
  <meta name="description" content="好好好好好好好好"/>
  <style type="text/css">
    .mask{ display:none; position:absolute;top:0;left:0;width:100%;height:100%;background:#000;z-index:100;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);height:1000px;}
    .tanchu{ width:600px;height:300px;position:absolute; top:50%;left:50%;margin:-150px 0 0 -300px; z-index:101; background:green;display:none;}
    .close{ color:#fff; cursor:pointer;}
  </style>
  <script src="http://jt.875.cn/js/jquery.js" type="text/javascript"></script>
  <!–[if ie]>
  <script src="http://jt.875.cn/js/html5.js" type="text/javascript"></script>
  <![endif]–>

<script type="text/javascript">
   $(function(){
    $(".input").click(function(){
    $(".tanchu").show()
    $(".mask").css({ display: "block", height: $(document).height() });//获取高度,兼容IE6。如果不考虑IE6直接可以换成show()
    });
     $(".close").click(function(){
      $(".tanchu").hide()
      $(".mask").hide()
    });
  });
  </script>
</head>

<body>
 <div class="mask"></div>
    <p><input class="input" type="button" style="width:100px; height:30px;" /></p>
    <div class="tanchu">
       <a class="close">点我关闭层</a>
       <p>我是一个弹出层我是一个弹出层我是一个弹出层我是一个弹出层啊 我是一个弹出层</p>
     </div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值