帮忙看看这个JS菜单

dgseamaple 2003-12-08 04:54:24
默认状态下全部子菜单都是打开的,我希望我一进入页面时,所有的子菜单都是关闭的,请大侠帮忙改一下,我对js不是太熟悉,谢谢!

<script>// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
var p, i, foundObj;

if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
{
theDoc = parent.frames[theObj.substring(p+1)].document;
theObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

return foundObj;
}
</script>


<table>
<tr>
<td class="menu" onMouseUp="with(findObj('ph'))if(style.display=='none'){style.display='';this.style.backgroundImage='url(images/control/o.gif)'}else{style.display='none';this.style.backgroundImage='url(images/control/c.gif)'}"><strong>资料管理</strong></td>
</tr>
<tr id="ph">
<td class="submenu"><table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="file"><a href="company.asp" class="menutop" target="mainFrame">基本数据</a></td>
</tr>
<tr>
<td class="file"><a href="change_pwd.asp" class="menutop" target="mainFrame">修改密码</a></td>
</tr>
</table>
...全文
76 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
coffee_cn 2003-12-11
  • 打赏
  • 举报
回复
<table>
<tr>
<td class="menu" onMouseUp="with(findObj('ph'))if(style.display=='none'){style.display='';this.style.backgroundImage='url(images/control/o.gif)'}else{style.display='none';this.style.backgroundImage='url(images/control/c.gif)'}"><strong>资料管理</strong></td>
</tr>
<tr id="ph" style="display:none">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~here

<td class="submenu"><table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="file"><a href="company.asp" class="menutop" target="mainFrame">基本数据</a></td>
</tr>
<tr>
<td class="file"><a href="change_pwd.asp" class="menutop" target="mainFrame">修改密码</a></td>
</tr>
</table>
nchen123 2003-12-11
  • 打赏
  • 举报
回复
<script>// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
var p, i, foundObj;

if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
{
theDoc = parent.frames[theObj.substring(p+1)].document;
theObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

return foundObj;
}
</script>


<table>
<tr>
<td class="menu" onMouseUp="with(findObj('ph'))if(style.display=='none'){style.display='';this.style.backgroundImage='url(images/control/o.gif)'}else{style.display='none';this.style.backgroundImage='url(images/control/c.gif)'}"><strong>资料管理</strong></td>
</tr>
<tr id="ph" style="display:none">
<td class="submenu"><table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="file"><a href="company.asp" class="menutop" target="mainFrame">基本数据</a></td>
</tr>
<tr>
<td class="file"><a href="change_pwd.asp" class="menutop" target="mainFrame">修改密码</a></td>
</tr>
</table>
dgseamaple 2003-12-09
  • 打赏
  • 举报
回复
顶一下
leeeel 2003-12-08
  • 打赏
  • 举报
回复
replace style="display:none" as style="display:block"
先看效果: https://pan.quark.cn/s/100b93cbf1c2 小爱Admin A magical vue element touzi admin. 分支说明: master分支:前后端统一开发的版本;可以用于学习nodejs+mongodb+express相关知识; dev分支:进行了前后端分离的版本;用户只关注于前端部分,可忽略服务端;下载下来,即可运行; dev-permission分支: 增加了权限管理(包括页面权限和按钮权限)的功能和顶栏三级菜单显示,完全剥离nodejs后台,使用mockjs模拟数据,让用户只需关注前端,更容易上手学习。 目前此分支为正常维护分支。 如有需要,请大家clone本分支代码运行。 项目博客文档 vue-小爱ADMIN系列文章(一):用Vue-cli3+mockjs 实现后台管理权限和三级菜单功能 vue-小爱ADMIN系列文章(二):微信微博等分享,国际化,前端性能优化,nginx服务器部署 提示 如果你觉得该项目对你有帮忙,记得给我点个赞star吧; About 本文主要讲解dev-permission分支内容: 技术栈 前端技术栈: vue2 + vuex + vue-router + webpack + ES6/7 + less + element-ui 服务端技术栈: mockjs 参考文档 vue:Vue是一套用于构建用户界面的渐进式框架。 vuex:Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式。 vue-router:Vue Router 是 Vue.js 官方的路由管理器。 webpack:前端模块打包器。 less:Less 是一门 CSS 预处理语言,它扩展了 CSS ...

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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