`
webdev2014
  • 浏览: 680052 次
文章分类
社区版块
存档分类
最新评论

felayman——显示遮罩

 
阅读更多
<!DOCTYPE html>
<html>
<head>
    <title>遮罩函数</title>
    <meta charset="UTF-8"/>
    <style type="text/css">
        #zhezhao{
            width: 100%;
            height: 100%;
            background: gray;
            display:none;
            position: absolute;
            left: 0;
            top: 0;
        }
        #contains{
            width: 520px;
            height: auto;
            background: #fff;
            display: none;
            position: absolute;
            left: 400px;
            top: 70px;
        }
    </style>
    <script type="text/javascript">
        function show(){
            document.getElementById("zhezhao").style.display="block";
            document.getElementById("contains").style.display="";
            document.getElementById("zhezhao").style.filter="Alpha(Opacity=50)";
        }
        function hide(){
            document.getElementById("zhezhao").style.display="none";
            document.getElementById("contains").style.display="none";
        }
    </script>
</head>
<body>
    <input type="button" value="显示遮罩" onclick="show()"/>
    <div id="zhezhao">
        <form>
            <p><label>请输入用户名:</label><input type="text" name="name"/></p>
            <p><label>请输入密码:<input type="password"name="pwd"/></label></p>
            <input type="button" value="隐藏遮罩" onclick="hide()"/>
        </form>
    </div>
    <div id="contains">

    </div>
</body>
</html>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics