純CSS和Javascript實現的遮罩層

來源:互聯網
上載者:User

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>純CSS和Javascript實現的遮罩層</title>
    <style>
        #cover
        {
            background: gray;
            position: absolute;
            left: 0px;
            top: 0px;
            display: none;
            z-index: 20;
            filter: alpha(opacity=60);
            opacity: 0.6 !important;
        }

        #close
        {
            position: absolute;
            display: none;
            z-index: 21 !important;
        }
    </style>

    <script>
        function show() {
            var cover = document.getElementById("cover");
            var close = document.getElementById("close");
            cover.style.width = document.documentElement.scrollWidth + "px";
            cover.style.height = document.documentElement.scrollHeight + "px";
            cover.style.display = "block";
            close.style.display = "block";
        }
        function hide() {
            var cover = document.getElementById("cover");
            var close = document.getElementById("close");
            cover.style.display = "none";
            close.style.display = "none";
        }
    </script>
</head>
<body>
    <div id="cover"></div>
    <input type="button" onclick="show()" name="name" value="顯示遮罩層" />
    <div id="close">
        <input type="button" onclick="hide()" name="name" value="隱藏遮罩層" />
    </div>
    <br />
    純CSS和Javascript實現的遮罩層
        <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
    <br />
    純CSS和Javascript實現的遮罩層
</body>
</html>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.