帮我看看这段代码

zzl888 2003-02-21 09:13:13
下面这代码是在一个左右框架页的左页,框架名字叫content,这代码主要实现像csdn这样的隐藏/显示左边菜单的,可是用到我自己的页面上就不行了,提示说top.content为空或不是对象,谁帮我解释一下以下两句的意思,顺便改正了,因为原页面中我也不见有对top定义的
<SCRIPT language=javascript>
function switchSysBar(){
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all("mnuList").style.display="none"
top.content.cols="10,*" //这一句不懂
}
else{
switchPoint.innerText=3
document.all("mnuList").style.display=""
top.content.cols="180,*" //这一句不懂
}
}

</SCRIPT>
<STYLE>.navPoint {
FONT-SIZE: 9pt; CURSOR: hand; COLOR: white; FONT-FAMILY: Webdings
}
</STYLE>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" height="339">
<TABLE height="200" border=0 align=center
cellPadding=0 cellSpacing=0 bgColor=#005d99 id=mnuList>
<TBODY>
<TR bgColor=#7d9dc0>
<TD width="100%" align=right><IMG height=8 src="menu.files/blank.gif"
width=10></TD>
</TR>
</TBODY>
</TABLE></TD>
<TD style="WIDTH: 10px" bgColor=#005d99>
<TABLE onclick=switchSysBar() height="100%" cellSpacing=0 cellPadding=0
width=12 border=0>
<TBODY>
<TR>
<TD vAlign=center align=middle><SPAN class=navPoint id=switchPoint
title=关闭/打开左栏>3</SPAN>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
...全文
51 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzl888 2003-02-21
  • 打赏
  • 举报
回复
明白了,我在框架中套用框架,怪不得会出错,谢谢了
烂笔头Danky 2003-02-21
  • 打赏
  • 举报
回复
top就是指调用框架的最顶层元素,即包括content框架的页面
top.content.cols指的是对contant框架的在页面中所占的列数
fly_miss 2003-02-21
  • 打赏
  • 举报
回复
top Property

Retrieves the topmost ancestor window.

genuis 2003-02-21
  • 打赏
  • 举报
回复
top应该是某个框架的名称。

87,996

社区成员

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

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