zoukankan      html  css  js  c++  java
  • div遮盖层

    <html>
    <head>
    <title></title>
    <script type="text/javascript">
    function show() {
    document.getElementById(
    "mask").style.display = "";
    document.getElementById(
    "content1").style.display = "";
    document.getElementById(
    "mask").style.filter = "Alpha(Opacity=10)";//透明度
    document.getElementById("content1").innerHTML = "你的内容<input onclick='hide()' type='button' value='确定'/>";
    }
    function hide() {
    document.getElementById(
    "mask").style.display = "none";
    document.getElementById(
    "content1").style.display = "none";
    }
    </script>
    </head>
    <body>
    <div style=" 100%; background-color:Gray; display:none; height: 100%; position:absolute;left:0px;top:0px;" id="mask"></div>
    <div style=" 260px; background-color:Blue; display:none; height: 113px; position:absolute; left: 244px; top: 137px;" id="content1"></div>
    <div id="fuck">
    <input onclick="show()" type="button" value="显示"/>
    </div>
    <script type="text/javascript">
    function ScrollDiv() {
    document.getElementById(
    "mask").style.top = document.body.scrollTop+ "px";
    document.getElementById(
    "mask").style.left = (document.body.scrollLeft) + "px";
    }
    window.onscroll
    = ScrollDiv;
    window.onresize
    = ScrollDiv;
    //window.onload = ScrollDiv;如果是ajax中用这个会出现问题。
    </script>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
    </body>
    </html>

  • 相关阅读:
    leetcode_697. 数组的度
    645. 错误的集合
    leetcode_448. 找到所有数组中消失的数字
    leetcode_628. 三个数的最大乘积
    leetcode_414. 第三大的数
    leetcode_495. 提莫攻击
    leetcode_485. 最大连续1的个数
    在 Mac、Linux、Windows 下Go交叉编译
    Goland基本操作
    etcd搭建及基本使用
  • 原文地址:https://www.cnblogs.com/xingbinggong/p/2182755.html
Copyright © 2011-2022 走看看