日期:2014-05-18  浏览次数:20496 次

弹出一个对话框,父页面便会色,同时不可操作。
看到有的网站,点击他的“登录”或者“注册”按钮,就谈出一个“登录”或者“注册”对话框给你填写。 
同时,父页面是灰色,不可改动的。 
直到你填写完“登录”或者“注册”提交后,父页面又变回原来的颜色,可用操作。 

请问这个效果和父页面不可操作的功能怎么做的? 
最好有个例子。 
谢谢

------解决方案--------------------
http://blog.csdn.net/showmy/archive/2007/10/10/1819096.aspx
------解决方案--------------------
为什么你不用一个层呢.
------解决方案--------------------
爱易网网站上有。你找一下吧
------解决方案--------------------
看了一楼的代码,也是用了div,z-index,元素随鼠标定位这些知识
------解决方案--------------------
js:
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function showMydiv()
{
document.body.scroll="no";
if(window.screen.Height>=document.body.scrollHeight)
{
id1.style.height = (window.screen.height - 155) +"px";
}
else
{
id1.style.height = (document.body.scrollHeight) + "px";
}
mydiv.style.position='absolute';
id1.style.width = (window.screen.width - 25) + "px";
id1.style.display = '';
mydiv.style.display = '';

// var frameId='myiframe';
// frameSrc='xxx.aspx';
// frames[frameId].document.write('loading...');
// frames[frameId].document.close();
// frames[frameId].location.href = frameSrc;

return false;
}
function HiddenDiv()
{
mydiv.style.display='none';
id1.style.display='none';
}
</script>
</head>

html:
<asp:Button ID="Button3" runat="server" Text="Button" OnClientClick="return showMydiv()"/></div>
<div id="mydiv" style="width:730px;height:900px;margin-top:-150px;margin-left:-300px;left:45%;top:27%;display:none;z-index:50;">
<table width="100%">
<tr>
<td align="right"><input id="Button2" type="button" value="X" onclick="HiddenDiv()"/>
</td>
</tr>
<tr>
<td align="center"> <iframe id="myiframe" width="100%" height="550px" scrolling="no" style="border-top-style: outset; border-right-style: outset; border-left-style: outset; border-bottom-style: outset"></iframe>
</td>
</tr>
</table>
 </div>
 
 <div id="id1" style="filter:Alpha(opacity=20);background-color:#000;position:absolute;top:0;left:0;z-index:49;display:none;">
<input id="hda" type="text" style="display:none" name="hda" />
</div>
------解决方案--------------------
javascript可以实现的,google一下有很多,

javascript遮照