当前位置:编程学习 > C#/ASP.NET >>

50分请帮忙解决下div遮罩问题,谢谢 !

代码如下:
<%@ Page language="c#" Inherits="HaoCMS.Pages.NewsList" EnableSessionState="false" EnableViewState="false"%>
<%@ Register TagPrefix="uc1" TagName="NewsSortTree" Src="/Control/NewsSortTree.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Head" Src="/Control/Head.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="/Control/Footer.ascx" %>
<html xmlns="http://www.w3.org/1999/xhtml" lang="<%=config.Charset%>">
<head>
<title><%=htmlTitle%></title>
<meta http-equiv="content-type" content="text/html;charset=<%=config.Charset%>"/>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<meta name="description" content="<%=config.MetaDescription%>"/>
<meta name="keywords" content="<%=info.Keywords%>"/>
<link rel="stylesheet" href="../style/style.css" type="text/css"/>
<script type="text/javascript">
var imgMaxWidth=<%=config.ImgMaxWidth%>;
var urlPrefix="";
</script>
<script>
function $(obj){
return document.getElementById(obj);
}
function showLayer(obj){
$(obj).style.display='block';
}
function hideLayer(obj){
$(obj).style.display='none';
}
function hideBody(){
with($('hiddenBody').style)
{
display = 'block';
height = document.documentElement.clientHeight + 'px';
}
}
</script>
<style type="text/css">
<!--
.login_layer {
position:absolute;
top:100px;
width:400px;
height:140px;
z-index:1000;
left: 30%;
}
#hiddenBody {
position: absolute;
width: 100%;
background-color: #000000;
FILTER: alpha(opacity=50); /* IE */
-MOZ-OPACITY: 0.5 /* Moz + FF */;
display:none;
height: 1000px;
z-index: 1000;
}
-->
</style>
</head>
<body onload="showLayer('login_layer'); hideBody();">
<div id="hiddenBody"></div>
<div id="login_layer" class="login_layer">
    <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#00CCFF" style="border-collapse:collapse">
      <form id="form1" name="form1" method="post" action="">
      <tr>
        <th height="30" colspan="2" align="center">用户登录</th>
      </tr>
      <tr>
        <td bgcolor="#FFFFFF">用户名</td>
        <td bgcolor="#FFFFFF"><input name="username" type="text" id="username" /></td>
      </tr>
      <tr>
        <td bgcolor="#FFFFFF">密  码</td>
        <td bgcolor="#FFFFFF"><input name="password" type="password" id="password" /></td>
      </tr>
      <tr>
        <td height="30" colspan="2" align="center" bgcolor="#E9E9E9"><input type="button" name="Submit" value="登录" onclick="checklogin()" />
          <input type="button" name="Submit2" value="关闭" onclick="hideLayer('login_layer');hideLayer('hiddenBody')" /></td>
      </tr>
      </form>
    </table>
</div>
<uc1:Head id="Head1" runat="server" href="/index.aspx"></uc1:Head>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td><table width="900" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="208" valign="top" background="/images/di02.jpg" bgcolor="#999999"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#B8B8B8">
          <tr>
            <td height="26" valign="middle" style="background-repeat:no-repeat;"><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
              <tr>
                <td><div align="center"><a href="/default.aspx"><img src="../images/anniu_03.jpg" width="53" height="18" border="0"></a></div></td>
                <td><div align="center"><a href="/en/default.aspx" target="_blank"><img src="../images/anniu_05.jpg" width="52" height="18" border="0"></a></div></td>
              </tr>
            </table></td>
          </tr>
          
        </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td bgcolor="#DFDFDF"><img src="../images/di02222.jpg" width="208" height="436"></td>
            </tr>
          </table></td>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="95%" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="550" height="31"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="back3">
                    <tr>
                      <td width="0" align="right" class="tm"><img src="../images/bullet.gif" alt="" width="7" height="18" class="tm" /></td>
                      <td class="tm">  Location :<%=StepPath(sortID, "News", "", "")%></td>
                    </tr>
                </table></td>
                <td width="60"><a href="/index.aspx"></a></td>
                <td><a href="/en/index.aspx" target="_blank"></a></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="mframe">
              <tr>
                <td valign="top" class="back2"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="100" valign="top"><div class="nList">
                        <div class="sort"><img src="../images/bullet2.gif" alt="" width="6" height="10" /> <%=sortName%></div>
                      <ul class="nl">
                          <img src="../images/99.jpg" width="666" height="112"><br>
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td>
                                      <div class="nList">
                                        <ul class="nl">
                                          <%=info.Introduction%><br />
                                          <asp:Repeater id="Repeater1" runat="server">
                                            <Itemtemplate>
                                              <li> <%#TitleUrl((System.Data.DataRowView)Container.DataItem) %><br />
                                              </li>
                                            </Itemtemplate>
                                          </asp:Repeater>
                                        </ul>
                                      <div><br />
                                            <asp:Literal id="ltNews" runat="server"/>                  
                                      </div>
                                    </div></td>
                                  </tr>
                              </table></td>
                            </tr>
                          </table>
                      </ul>
                    </div></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td> </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
<map name="Map"><area shape="rect" coords="1,1,50,20" href="/index.aspx">
</map>
</body>
</html>


现在打开页面登录窗口总是 闪一下,之后就没有了,我想要打开页面就显示登录窗口,登录后才显示内容。请高手帮忙看看,估计是样式有问题,可就是找不出来,郁闷!!!!!!! --------------------编程问答-------------------- 高手都跑哪去啦?
急!~~~~~~~~~ --------------------编程问答-------------------- function hideBody(){ 
with($('hiddenBody').style) 

display = 'none'; 
height = document.documentElement.clientHeight + 'px'; 


登陆后显示body
function showBody(){ 
with($('hiddenBody').style) 

display = 'block'; 
height = document.documentElement.clientHeight + 'px'; 

}  --------------------编程问答--------------------
Body=document.getElementsByTagName("body").item(0);
var Overlay=document.createElement("div");
Overlay.setAttribute("id","overlay");
var p_s = getPageSize();
Overlay.style.display = "";
Overlay.style.width = p_s[2] + "px";
Overlay.style.height = p_s[1] + "px";
Body.appendChild(Overlay);

var Main = document.createElement("div");
Main.setAttribute("id","editShowDiv");
Main.className = "floatwindow";
var pa = getPageSize();
Main.style.top =  (pa[3]/2 - 110 + parseInt(document.documentElement.scrollTop)) + "px";
Main.style.left = (pa[0]/2-220) + "px";
Main.style.zIndex = "11";
Body.appendChild(Main);
Main.innerHTML=html;
--------------------编程问答--------------------

function getPageScroll(){
var yScroll;
if (self.pageYOffset) {
yScroll = self.pageYOffset;
} else if (document.documentElement && document.documentElement.scrollTop){  // Explorer 6 Strict
yScroll = document.documentElement.scrollTop;
} else if (document.body) {// all other Explorers
yScroll = document.body.scrollTop;
}
arrayPageScroll = new Array('',yScroll) 
return arrayPageScroll;
};

function getPageSize(){

var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) {
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else { 
pageHeight = yScroll;
}
// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
return arrayPageSize;
};
--------------------编程问答-------------------- 高手都在工作
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,