html 遮罩层

<html>
    <title>js实现的遮罩层并可以移动的效果</title>
    <style type="text/css">
        body {
            margin: 0px;
        }
        .ch1{
            display: none;
            position: absolute;
            z-index: 1000;
            height: 100%;
            width: 100%;
            filter:Alpha(opacity=30);
        }
        .ch2{
            left: 0px;top: 0px; 
            display: none;
            position: absolute;
            height: 100%;
            width: 100%;
            padding-top: 10%;
            z-index: 1001;"
        }
    </style>

    <script type="text/javascript">
        function Open(id)
        {
            div1.style.display="block";
            id.style.display="block";
        }
        function Close(id)
        {
            div1.style.display="block";
            id.style.display="none";
        }
    </script>

    



<body>

    <div id="div1" class="ch1"></div>

    <table border="1">
    <tr>
    <td>
    <div id="div2"  class="ch2">

        <table width="480" border="0" cellpadding="5" cellspacing="1" style="background: #9098B5; " align="center">

            <tr style="cursor: move;">
                <td><font color="#FFFFFF">提示内容:</font></td>
                <td align="right"><input type="button" value="关闭" onClick="Close(div2)" style="cursor: hand;"></td>
            </tr>

            <tr>
                <td colspan="2" width="100%" bgcolor="#FFFFFF" height="150" align="middle"><input type=checkbox checked> aaa <input type=checkbox> bbb
                </td>
            </tr>

            <tr>
                <td><input type=button value=提交></td>
            </tr>

        </table>
    </div>

    <input name="button" type="button" οnclick="Open(div2)" value="配置1" />



    </td>


    <td>
    <div id="div4"  class="ch2">

        <table width="480" border="0" cellpadding="5" cellspacing="1" style="background: #ff7300; " align="center">

            <tr style="cursor: move;">
                <td><font color="#FFFFFF">提示内容:</font></td>
                <td align="right"><input type="button" value="关闭" onClick="Close(div4)" style="cursor: hand;"></td>
            </tr>

            <tr>
                <td colspan="2" width="100%" bgcolor="#FFFFFF" height="150" align="middle"><input type=checkbox> ccc <input type=checkbox checked> ddd
                </td>
            </tr>

            <tr>
                <td><input type=button value=提交></td>
            </tr>

        </table>
    </div>

    <input name="button" type="button" οnclick="Open(div4)" value="配置2" />
    </td>
        </tr>
    </table>


</body>
<html>


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值