关于框架的隐藏和显示问题

shanyao891020 2008-12-23 02:48:28
一个左 ,上下的框架。。
如何调用JavaScript令到上框架显示时下框架就自动隐藏,反之一样!!
可能利用按钮,或者双击上下框架响应显隐事件!!
框架代码如下:
<frameset rows="*" cols="200,10,*" framespacing="0" frameborder="yes" border="0" bordercolor="#FFFF99" id="infoFrame">

<frame src="../jsp/leftFrame.jsp" name="leftFrame" frameborder="no" scrolling="no" noresize="">
</frame>
<frame id="leftbar" scrolling="no" noresize="" name="switchFrame" src="swich.html">
</frame>
<frameset name="frmParent" rows="203,314" cols="*" framespacing="1" frameborder="yes" border="1" bordercolor="#333333">
<frame src="searchFrame.html" name="searchFrame" frameborder="no" scrolling="no" onload="frmParent.rows = searchFrame.document.body.offsetHeight + ',*'">

<frame src="mainFrame.html" name="mainFrame" frameborder="no" scrolling="no" >
</frameset>
</frame>
</frameset>


具体怎样实现上下框架的显示和隐藏!!高手请帮忙 - -
感激!!!
...全文
95 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
不悲不喜 2008-12-24
  • 打赏
  • 举报
回复
示例
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<frameset cols="200,10,*" framespacing="0" frameborder="yes" border="0" bordercolor="#FFFF99" id="infoFrame">
<frame src="../jsp/leftFrame.jsp" name="leftFrame" frameborder="no" scrolling="no" noresize="">
</frame><frame id="leftbar" scrolling="no" noresize="" name="switchFrame" src="swich.html">
</frame>
<frameset name="frmParent" rows="203,314" framespacing="1" frameborder="yes" border="1" bordercolor="#333333">
<frame src="searchFrame.html" name="searchFrame" frameborder="no" scrolling="no" onload="frmParent.rows = searchFrame.document.body.offsetHeight + ',*'">
<frame src="mainFrame.html" name="mainFrame" frameborder="no" scrolling="no">
</frameset>
</frame>
</frameset>
</html>


searchFrame.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<h1>searchFrame</h1>
<input type="button" value="close me" onclick="top.frmParent.rows='0,100%';">
</body>
</html>


mainFrame.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<h1>Bottom Frame</h1>
<input type="button" value="close me" onclick="top.frmParent.rows='100%,0';">
</body>
</html>
hx_huang 2008-12-23
  • 打赏
  • 举报
回复
在searchFrme.html中用户Javascropt来实现
function show(){
parent.leftFrame.rows="0,*";
具体的不说了,按我的方法应该可以实现!!!!
}

87,914

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧