首页 > 我晕了,这个代码在ie8上报缺少对象。。。

我晕了,这个代码在ie8上报缺少对象。。。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ie8 filter opacity</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="http://cdn.code.baidu.com/normalize.css" rel="stylesheet">
</head>
<style type="text/css">
    .popbg-click, .popbg-unclick {
        display: none;
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        z-index: 1;
    }
    .popbg-click {
        background: #000;
        opacity: 0.75;
        filter: alpha(opacity=75);
    }
    .popbg-unclick {
        background-color: rgba(7, 4, 22, 0.8);
          filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr=#cc070416, endColorstr=#cc070416);
    }

    .see {
        display: block;
        width: 500px;
        height: 400px;
        background-color: rgba(33, 33, 33, .8);
        color: red;
    }
</style>
<body>
    <h3 class="unclick">ie8蒙层关不掉</h3>
    <h3 class="click">ie8点击蒙层关闭</h3>
    <div class="popbg-unclick"></div>
    <div class="popbg-click"></div>
</body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" class="see">
$(document).ready(function(){
    $(".unclick").click(function(){
        $(".popbg-unclick").show()
    })

    $(".click").click(function(){
        $(".popbg-click").show()
    })

    $(".popbg-unclick").click(function(){
        $(this).hide()
    })

    $(".popbg-click").click(function(){
        $(this).hide()
    })
})
</script>
</html>


现在看下来是因为公司电脑系统的ie版本问题,代码本身没问题。。。

【热门文章】
【热门文章】