HTML frameset弹DIV问题
<head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><scripttype="t...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="<%=basePath%>js/jquery1.6.1.js">
</script>
<title>department</title>
</head>
<frameset rows="80,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="header.jsp" name="topFrame" scrolling="no" noresize="noresize" id="topFrame" title="topFrame" />
<frameset cols="176,*" frameborder="no" border="0" framespacing="0">
<frame src="left.jsp" name="leftFrame" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" />
<frame src="welcome.jsp" name="mainFrame" scrolling="no" id="mainFrame" title="mainFrame" />
</frameset>
</frameset>
<noframes><body>
这是我的框架页面 在header.jsp里边有一个按钮“锁定” 点击锁定弹出一个div层来覆盖整个浏览器 请问怎么实现 展开
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="<%=basePath%>js/jquery1.6.1.js">
</script>
<title>department</title>
</head>
<frameset rows="80,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="header.jsp" name="topFrame" scrolling="no" noresize="noresize" id="topFrame" title="topFrame" />
<frameset cols="176,*" frameborder="no" border="0" framespacing="0">
<frame src="left.jsp" name="leftFrame" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" />
<frame src="welcome.jsp" name="mainFrame" scrolling="no" id="mainFrame" title="mainFrame" />
</frameset>
</frameset>
<noframes><body>
这是我的框架页面 在header.jsp里边有一个按钮“锁定” 点击锁定弹出一个div层来覆盖整个浏览器 请问怎么实现 展开
2个回答
展开全部
<html>
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js弹出蒙层</title>
</head>
<body>
<form id="form1" runat="server">
<div id="divTest" style="position: absolute; z-index: 3; width: 410px; height: 170px;
background-color: Yellow; display: none; top: 100px; left: 100px;">
<div id="dd" style="background-color: Red; width: 365px; height: 20px; float: left;"
onmousedown="down()">
这是标题,可拖动
</div>
<div style="background-color: Red; width: 35px; height: 20px;">
<a onClick="closes()">关闭</a>
</div>
</div>
<div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;
z-index: 2; left: 0px; display: none;">
</div>
<div id="main" style="background-color: Azure; height:700px;">
<div>
<a onClick="show()">弹出蒙层</a>
</div>
<div>
</div>
<br />
</div>
</form>
<script type="text/javascript">
function show()
{
document.all.ly.style.display="block";
document.all.ly.style.width=document.body.clientWidth+20;
document.all.ly.style.height=document.body.clientHeight+20;
document.all.divTest.style.display='block';
document.getElementById("divTest").style.visibility="visible";
}
function closes()
{
if(window.confirm("关闭这个层"))
{
document.getElementById("divTest").style.visibility="hidden";
document.all.ly.style.display='none'
}
}
var px=0;
var py=0;
var begin=false;
var topDiv;
function down()
{
begin=true;
document.getElementById("divTest").style.cursor= "hand";
event.srcElement.setCapture();
px=document.getElementById("divTest").style.pixelLeft - event.x;
py=document.getElementById("divTest").style.pixelTop - event.y;
}
function document.onmousemove()
{
if(begin)
{
document.getElementById("divTest").style.pixelLeft = px+event.x;
document.getElementById("divTest").style.pixelTop = py+event.y;
}
}
function document.onmouseup()
{
begin=false;
document.getElementById("divTest").style.cursor= "default";
event.srcElement.releaseCapture();
}
</script>
</body>
</html>
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js弹出蒙层</title>
</head>
<body>
<form id="form1" runat="server">
<div id="divTest" style="position: absolute; z-index: 3; width: 410px; height: 170px;
background-color: Yellow; display: none; top: 100px; left: 100px;">
<div id="dd" style="background-color: Red; width: 365px; height: 20px; float: left;"
onmousedown="down()">
这是标题,可拖动
</div>
<div style="background-color: Red; width: 35px; height: 20px;">
<a onClick="closes()">关闭</a>
</div>
</div>
<div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;
z-index: 2; left: 0px; display: none;">
</div>
<div id="main" style="background-color: Azure; height:700px;">
<div>
<a onClick="show()">弹出蒙层</a>
</div>
<div>
</div>
<br />
</div>
</form>
<script type="text/javascript">
function show()
{
document.all.ly.style.display="block";
document.all.ly.style.width=document.body.clientWidth+20;
document.all.ly.style.height=document.body.clientHeight+20;
document.all.divTest.style.display='block';
document.getElementById("divTest").style.visibility="visible";
}
function closes()
{
if(window.confirm("关闭这个层"))
{
document.getElementById("divTest").style.visibility="hidden";
document.all.ly.style.display='none'
}
}
var px=0;
var py=0;
var begin=false;
var topDiv;
function down()
{
begin=true;
document.getElementById("divTest").style.cursor= "hand";
event.srcElement.setCapture();
px=document.getElementById("divTest").style.pixelLeft - event.x;
py=document.getElementById("divTest").style.pixelTop - event.y;
}
function document.onmousemove()
{
if(begin)
{
document.getElementById("divTest").style.pixelLeft = px+event.x;
document.getElementById("divTest").style.pixelTop = py+event.y;
}
}
function document.onmouseup()
{
begin=false;
document.getElementById("divTest").style.cursor= "default";
event.srcElement.releaseCapture();
}
</script>
</body>
</html>
展开全部
在header.jsp的JS里添加window.parent.div显示
更多追问追答
追问
能具体点吗?
追答
调用父级中的 aaa的函数
子页面中:
onclick="window.parent.frames.aaa()"
父页面中:
function aaa()
{
alert(‘bbbbb’);
}
或者直接拿对象进行操作
window..parent.frames.document.getElementById(‘xx’);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询