层模仿confirm

使用层来模仿confirm的效果,无论窗口大小如何改变用于用于交互的2各层始终位于窗口中央位置。
css用来定制滚动条的效果
js控制层的显示与隐藏以及背景层的大小 

 

< style  type ="text/css" >
html
{height:100%}
body
{
  margin
:0; /* 必须 */
  height
:100%; /* 必须 */
  overflow-y
:auto;/* 必须 */
 
}

#divConfim
{
  background-color
:#92E076;background-image: url(../Skin/Computer/Online/Install_Background.gif);z-index:10001;
  position
:fixed !important;   /*For FF*/
  left
:expression((document.body.clientWidth-this.offsetWidth)/2);position:absolute;   /*For IE*/
  top
:expression((document.body.clientHeight-this.offsetHeight-20)/2);
}

#submitPaper
{
  background-color
:#92E076;background-image: url(../Skin/Computer/Online/Install_Background.gif);z-index:10002;
  position
:fixed !important;   /*For FF*/
  left
:expression((document.body.clientWidth-this.offsetWidth)/2);position:absolute;   /*For IE*/
  top
:expression((document.body.clientHeight-this.offsetHeight-20)/2);
}


<div id="bgDiv" style=" background:#000; z-index:10000; position:absolute; left:0px; top:0px;filter:alpha(opacity=20); color: #ffffff; display:none;">
    &nbsp;</div>
    <script>
        divW();
        function divW()
        
{
            bgDiv.style.width=(document.body.clientWidth-15);
            bgDiv.style.height=(document.body.clientHeight);
        
}

        function window.onresize()
        
{
            bgDiv.style.width=(document.body.clientWidth);
            bgDiv.style.height=(document.body.clientHeight);
        
}
 
    </script>

    <div id="divConfim" align="center" style="width: 400; height: 252;display:none; ">
        <table width="400" height="252" border="1" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="center">
                    <p>
                        <img src="../Skin/Computer/Online/Install_Notice4.gif" width="130" height="16" /></p>
                    <p>
                        &nbsp;</p>
                    <table width="147" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="60" height="40" align="center" style=" background-color:#FFC255;cursor:hand;">
                                <a href="javascript:;" class="bt3font" οnclick="yes()" style="color: #CC5200; font-size: 18px;
                                    font-family: 黑体">是</a></td>
                            <td width="50">
                                &nbsp;</td>
                            <td height="40" align="center" style="background-color:#FFC255;cursor:hand;
                                width: 60px;">
                                <a href="javascript:;" class="bt3font" οnclick="no();go()" style="color: #CC5200; font-size: 18px;
                                    font-family: 黑体">否</a></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div id="submitPaper" align="center" style="width: 400; height: 252;display:none; ">
        <table width="400" height="252" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="center">
                    <p>
                        <img src="../Skin/Computer/Online/Install_Notice3.gif" width="233" height="16" /></p>
                    <p>
                        &nbsp;</p>
                    <table width="94" border="0" cellspacing="0" cellpadding="0">
                        <!--DWLayoutTable-->
                        <tr>
                            <td height="40" align="center" style="background-color:#FFC255; cursor:hand;
                                width: 94px;">
                                <a href="javascript:;" οnclick="yes()" class="bt3font" style="color: #CC5200; font-size: 18px;
                                    font-family: 黑体">确 定</a></td>
                                    
                        </tr>
                    </table>
                    </td>
            </tr>
        </table>
    </div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值