弹出一个对话框,灰掉原来的页面(网页)

< html >

< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" >
< title > http://hi.csdn.net/YoungEngineer/profile </ title >
</ head >

< body style ="margin:0;" >

< div style ="font-size:10pt;" >
注1:灰掉页面
< br />

< br />  
注:本页面仅在dreamwear下测试过。其它浏览器或其它版本未经测试。
< br />         
注-----:JK:
< a href ="mailTo:jk_10000@yahoo.com.cn?subject=About Body" > JK_10000@yahoo.com.cn </ a >< br />      
< hr />  
</ div >


< select >< option > test </ option ></ select >
< input >
< input type =button value ="点击将页面灰掉" onclick ="disableBodyArea();" >
< br >< br >< br >< br >
< br >< br >< br >< br >
< select >< option > test </ option ></ select >
< br >< br >< br >< br >
< br >< br >< br >< br >
< select >< option > test </ option ></ select >
< br >< br >< br >< br >
< br >< br >< br >< br >
</ body >

</ html >
< script >

function disableBodyArea(){
   
if ( ! document.all) return false ; // For firefox etc.
    window.topCoverDiv = document.createElement( " <div style='z-index:100;position:absolute;top:expression(this.offsetParent.scrollTop);left:expression(this.offsetParent.scrollLeft);width:100%;height:100%;filter:alpha(opacity=20);background-color:#888888;' οncοntextmenu='return false;'> " );
    topCoverDiv.innerHTML
= " &nbsp; "
    document.body.appendChild(topCoverDiv);
   
var allSelects = document.getElementsByTagName( " select " );
   
for ( var i = 0 ;i < allSelects.length;i ++ ) {
        allSelects[i].disabled
= true ;
        allSelects[i].style.backgroundColor
= " #EEEEEE " ;
    }
}

</ script > 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值