在web里显示各种菜单
来源:互联网 发布:淘宝买家权重查询 编辑:程序博客网 时间:2024/05/27 14:14
web上用javascript实现的各种菜单
在web上出现的菜单,常见的的无非两种,一则,如win菜单,鼠标移动上去或者单击时候弹出, 二则。如资源管理器中的树目录结构 ,具体效果如下显示:
其主要源码如下:
<!--StartFragment--><table width="100%">
<caption>win式菜单</caption>
<tr>
<th id="Th1" onmouseover="javascript:mouse_over('item1')">
菜单1
</th>
<th id="Th2"onmouseover="javascript:mouse_over('item2')">
菜单2
</th>
<th id="Th3" onmouseover="javascript:mouse_over('item3')">
菜单2
</th>
</tr>
<tr>
<td align="center" onmouseout="javascript:mouse_out('item1')">
<div id="Div1" style="display:none">
<table>
<tr><th>项1</th></tr>
<tr><th>项2</th></tr>
<tr><th>项3</th></tr>
</table>
</div>
</td>
<td align="center" onmouseout="javascript:mouse_out('item2')">
<div id="Div2" style="display:none">
<table>
<tr><th>项1</th></tr>
<tr><th>项2</th></tr>
<tr><th>项3</th></tr>
</table>
</div>
</td>
<td align="center" onmouseout="javascript:mouse_out('item3')">
<div id="Div3" style="display:none">
<table>
<tr><th>项1</th></tr>
<tr><th>项2</th></tr>
<tr><th>项3</th></tr>
</table>
</div>
</td>
</tr>
</table>
<hr />
<table width="100%">
<caption>树结构菜单</caption>
<tr>
<td>
<a href="javascript:open('item4')">菜单1</a>
<div id="Div4" style="display:none">
<table>
<tr><td>|-项1</td></tr>
<tr><td>|-项2</td></tr>
<tr><td>|-项3</td></tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<a href="javascript:open('item5')">菜单2</a>
<div id="Div5" style="display:none">
<table>
<tr><td>|-项1</td></tr>
<tr><td>|-项2</td></tr>
<tr><td>|-项3</td></tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<a href="javascript:open('item6')">菜单3</a>
<div id="Div6" style="display:none">
<table>
<tr><td>|-项1</td></tr>
<tr><td>|-项2</td></tr>
<tr><td>|-项3</td></tr>
</table>
</div>
</td>
</tr>
</table>
<hr />
<script language="javascript" type="text/javascript">
<!--
//初始化层管理器
var layouts = new Array();
layouts.push("item1");
layouts.push("item2");
layouts.push("item3");
layouts.push("item4");
layouts.push("item5");
layouts.push("item6");
//层处理函数
function out_layout(divname)
{
for(var i = 0; i < layouts.length; ++i)
if(document.getElementById(layouts[i]))
document.getElementById(layouts[i]).style.display='none';
document.getElementById(divname).style.display = "block";
}
//事件处理函数
function mouse_over(divname)
{
//document.getElementById(meum).style.backgroud-color = BLUE;
if(document.getElementById(divname).style.display == "none")
out_layout(divname);
}
function mouse_out(divname)
{
document.getElementById(divname).style.display = "none";
}
function open(divname)
{
if(document.getElementById(divname).style.display != "none")
document.getElementById(divname).style.display = "none";
else
out_layout(divname);
}
-->
</script>
- 在web里显示各种菜单
- 把TC的功能全部显示在菜单项里
- 辛星教你如何在Sublime里显示菜单
- 在工程里寻找各种对象(如:右键菜单pop1,在menus里面寻找)
- VS2008基于对话框,在资料里添加了菜单,界面不显示菜单问题
- Java web 从数据库读取菜单,显示在jsp中
- 在菜单中显示图标
- 在应用程序菜单里添加软件
- 在地址栏里显示icon
- 在地址栏里显示logo
- 在emacs里显示行号
- Web park 原型 (在一个firefox的tab里同时显示多个窗口)
- 各种菜单
- 各种菜单
- 在wxWidgets菜单上显示图标
- 在 IE 7 菜单不能正常显示
- 在导航菜单中显示业务代码
- 让superfish的菜单在左边显示
- 2005.11.22 Bank5小组第七次会议
- Quartz从入门到进阶
- DB2 中的事务 ID
- 不需xp_cmdshell支持在有注入漏洞的SQL服务器上运行CMD命令
- Solaris 9 Sparc下安装整合Apache2和Tomcat5
- 在web里显示各种菜单
- Introducing the Abstract Factory Pattern
- EditPlus 2.12 使用技巧集萃
- 在C#里实现DATAGRID的打印预览和打印
- 调度程序改完
- C#验证输入的是否数字的方法
- 关于移动鉴权
- C++对象布局及多态实现探索之内存布局(转载)
- 论C/C++函数间动态内存的传递(转载)