博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

龙的心·专栏

phpshao.cublog.cn
用js背景变灰并且功能失效
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript">
function G(id){
    return document.getElementById(id);
};
function GC(t){
   return document.createElement(t);
};
String.prototype.trim = function(){
          return this.replace(/(^\s*)|(\s*$)/g, '');
};
function isIE(){
      return (document.all && window.ActiveXObject && !window.opera) ? true : false;
}
 
function cancelSign(){
    G("sign_div").style.display = 'none';
    G("cover_div").style.display = 'none';
   document.body.style.overflow = '';
};

function popCoverDiv(){
   if (G("cover_div")) {
    G("cover_div").style.display = '';
   } else {
    var coverDiv = GC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style) {
     position = 'absolute';
     background = '#CCCCCC';
     left = '0px';
     top = '0px';
     var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 98;
     if (isIE()) {
      filter = "Alpha(Opacity=60)";
     } else {
      opacity = 0.6;
     }
    }
   }
}
function getBodySize(){
   var bodySize = [];
   with(document.documentElement) {
    bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
    bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;
   }
   return bodySize;
}
function popSign(az_id){
   var loginDivWidth = 300;
   var sign_in_flow = '<div style="background:#FF9900;">登陆</div><div>e-mail:</div><div>'
       + '<input type="text" id="sign_email" maxlength="64" size="30"/>'
       + '</div><div>password:</div><div><input type="password" id="sign_pwd" size="30"/>'
        + '</div><div><input type="button" value="login" id="sign_button"/>   '
        + '<input type="button" value="cancel" onclick="cancelSign();"/></div>';

   if (G("sign_div")) {
    G("sign_div").style.display = '';
   } else {
    var signDiv = GC('div');
    document.body.appendChild(signDiv);
    signDiv.id = 'sign_div';
    signDiv.align = "center";
 
    with (signDiv.style) {
     position = 'absolute';
     left = (document.documentElement.clientWidth - loginDivWidth)/2 + 'px';
     top = (document.documentElement.clientHeight - 300)/2 + 'px';
     width = loginDivWidth + 'px';
     zIndex = 99;
     background = '#FFFFFF';
     border = '#66CCFF solid 1px';
    }
   }
    G("sign_div").innerHTML = sign_in_flow;
 
 
}
function popSignFlow(az_id) {
   popCoverDiv(); 
   popSign(az_id); 
   document.body.style.overflow = "hidden";
    
     
}

</script>
</head><body><div>
<input type="text" value="PHP学习网"/><p>
<input type="button" onclick="popSignFlow(6);" value="login"/>
<br>
<a href="www.phpshao.cn">www.phpshao.cn</a><br>dsfk<br> sda fsda<br><br>sd<br><br>sd<br><br><br><br><br>
</p>
</div></body></html>

发表于: 2007-11-04,修改于: 2007-11-04 19:50,已浏览1395次,有评论0条 推荐 投诉

给我留言
版权所有 ChinaUnix.net 页面生成时间:18.67466