javascript控制框架

Atu8000 2003-01-04 07:47:58
怎样用javascript控制其它框架隐藏和显示?
...全文
53 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
希偌 2003-01-05
  • 打赏
  • 举报
回复
应该体谅“思归”,他在USA,那没有中文输入法?!
saucer 2003-01-05
  • 打赏
  • 举报
回复
try something like

to hide:
top.document.body.rows = "0,*";
or
top.document.body.cols = "0,*";

to show:
top.document.body.rows = "300,*";
or
top.document.body.cols = "300,*";
wealth 2003-01-05
  • 打赏
  • 举报
回复
up
孟子E章 2003-01-05
  • 打赏
  • 举报
回复
<frameset cols="200,30,*" id=mxh frameborder=0>
<frame src="">
<frame src="frame1.htm" style="border:2px solid red">
<frame src="">
</frameset>

frame1.htm
=============
<body leftmargin=0>
<input type="button" value="<<" onclick="showFrame(this)">
<script language="javascript">
function showFrame(o)
{
a=top.document.getElementById("mxh")
if(a.cols=="200,30,*"){
a.cols="0,50,*"
o.value=">>"
}
else
{
a.cols="200,30,*"
o.value="<<"
}
}
</script>
wgrabob1 2003-01-05
  • 打赏
  • 举报
回复
在说了,你也不看情况就告诉人家,说错了怎么办



我建议楼主弄本MSDN的DHTML教程更容易解决问题



wgrabob1 2003-01-05
  • 打赏
  • 举报
回复
我有点不喜欢了思###


了,何必在这装假洋鬼子了
skyover 2003-01-05
  • 打赏
  • 举报
回复
function hide()
{
var o = document.images[0];
top.b.cols='11,*';top.c.cols='0,*';
o.src="images/l.gif";
document.all.className='r';
}
function show()
{
var o = document.images[0];
top.b.cols='144,*';top.c.cols='133,11';
o.src="images/r.gif";
document.all.className='l';
}
function act(e)
{
var o = document.images[0];
if(o.src.match("images/r.gif")!=null)
{
hide();
}
else
{
show();
}
}

b是框架的ID
saucer 2003-01-05
  • 打赏
  • 举报
回复
document.body refers to the frameset object in the frameset window

try

1. frameset.html:
<frameset rows="200,*">
<frame src="">
<frame src="frame1.html">
</frameset>

2. frame1.html:
<input type="button" value="hide" onclick="showFrame(this)">

<script language="javascript">
function showFrame(obj)
{
if (obj.value == "hide")
{
top.document.body.rows = "0,*";
obj.value = "show";
}
else
{
top.document.body.rows = "200,*";
obj.value = "hide";
}
}
</script>
希默软件 2003-01-05
  • 打赏
  • 举报
回复
为什么是document.body.cols或者document.body.rows,可以这样用么?
应该是该Frameset的name吧

87,996

社区成员

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

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