经典的导航二级式导航菜单完整程序及中文注释,强力推荐[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 lshdic 的 blog

<!--
作者语:在csdn很久了,得到许多热心网友的帮助并收集过很多好的文章,无奈自己时间实在有限,一直没为csdn的网友做过什么贡献,现在正好做了个程序,我就写上注释送给大家研究吧:)

以下是我设计的导航栏(因着手简化代码因此忽略其他html代码),详细实例请登陆http://www.lshdic.com

以下代码在线测试请登陆http://www.lshdic.com/editdhtml.asp
-->

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta name="generator" content="网络程序员伴侣-lshdic 2002">
<meta name ="keywords" content="lshdic,蓝丽网,html,css,javascript,vbscript,asp,sql,dhtml,vml,php,jsp,xml,vrml,vb,vc,delphi,开发,电脑,网络,编程,程序员,下载,软件,网页,编辑器,技术论坛">
<style>
a{text-decoration:none;}
a:hover{color:blue}
td{font-size:12px;color:555555}
.a1{font-size:14px}
</style>
</head>
<body vlink=#6772cd link='#6772cd'>
<base href='http://www.lshdic.com/'>
<table cellspacing=0 cellpadding=1 width=770 align=center style='border-width:0' bgcolor='#bbe2f5' frame=below rules=none bordercolordark=white bordercolorlight=dddddd id=menutd>  <!--最外围表格-->
<tr align=right><td height=25 align=left id=menutd1>      <!--存放回首页的td单元格-->
<a href='index.asp' style='font-size:13px'>回首页</a>
</td>
<!--以下就开始着手构建菜单了-->
<td>
<a href='#' style='font-size:13px' onmouseover="movese('flashmtv 经典音乐|dj舞曲 经典电影','happy.asp|happy2.asp')">娱乐视听</a> &nbsp;
<a href='wenzhang.asp' style='font-size:13px' onmouseover="movese('网络编程语言**html**css**javascript**vbscript**dhtml**vml**activex**asp**php**jsp**sql+ado**xml+*.net**其他网络技术|软件编程语言**basic+vb**c语言+vc+cb**java+vj+j2ee**pb+delphi**vfp+汇编|-|其他非编程学术|蓝丽所有网友问题|查找所有技术文章','被屏蔽网址**wenzhang.asp?str=html<font style=display:none>dhtml&page=1**wenzhang.asp?str=css&page=1**wenzhang.asp?str=javascript/js&lt;font style=display:none>jsp&page=1**wenzhang.asp?str=vbs&page=1**wenzhang.asp?str=dhtml&page=1**wenzhang.asp?str=vml&page=1**wenzhang.asp?str=activex&page=1**wenzhang.asp?str=asp&page=1**wenzhang.asp?str=php&page=1**wenzhang.asp?str=jsp&page=1**wenzhang.asp?str=sql/ado&page=1**wenzhang.asp?str=xml/.net/xsl&page=1**wenzhang.asp?str=fso/wsh/htc/正则/object/iis/pws/vrml&page=1|被屏蔽网址**wenzhang.asp?str=basic/vb<font style=display:none>vbs&page=1**wenzhang.asp?str=c语言/vc/cb&page=1**wenzhang.asp?str=vj/j2ee/java<font style=display:none>javascript&page=1**wenzhang.asp?str=pb/delphi&page=1**wenzhang.asp?str=vf/汇编&page=1||wenzhang.asp?str=英语/注册表:/微软/驱动程序/硬件/黑客/加密/解密/攻击/防御/入侵/红客/外语/业界/理论/趋势/破解/工作/程序员/设计师/新闻/社会/讲座/病毒&page=1|wenzhang.asp?str=请问/问题/难题/请教/帮忙/帮助/帮忙/sos/help/解决/有没有/帮帮/救命/救救/急/教我/愁/谁能/能不/可不可/行不/怎么/提问/怎样/才能/能让&page=1|bbs/instr.asp')">技术文章</a> &nbsp;
<a href='download.asp' style='font-size:13px' onmouseover="movese('编程类工具软件|电子教程|编程素材','download.asp?screen=工具软件&page=1|download.asp?screen=电子教程&page=1|download.asp?screen=编程素材&page=1')">下载中心</a> &nbsp;
<a href='editweb.asp' style='font-size:13px' onmouseover="movese('进入网页编辑中心|下载编辑网页v2版','editweb.asp|download2.asp?id=48')">编辑网页</a> &nbsp;
<a href='editdhtml.asp' style='font-size:13px' onmouseover="movese('进入程序编辑中心|下载编写程序v2版','editdhtml.asp|download2.asp?id=92',1000)">编写程序</a> &nbsp;
<a href='lshdic2002.asp' title='进行注册,领取lshdic200x软件序列号的地方' style='font-size:13px' onmouseover="movese('查看领取lshdic序列号|注册购买lshdic序列号|注册购买流程简介','lshdic2002.asp|lshdic2002one.asp|lshdic2002help1.asp')">lshdic</a> &nbsp;
<a href='bbs2.asp' style='font-size:13px' onmouseover="movese('查看客户所有留言|签写新留言','bbs2.asp|bbs2fatie.asp')">留言我们</a> &nbsp;
<a href='bbs/index.asp' style='font-weight:bold' onmouseover="movese('网页版面美工设计|网页前台脚本编程|网页后台脚本编程|xml与net时代编程|软件开发交流论坛|讨论区及其他学术|-|会员登陆注册入口','bbs/page.asp?dex=网页版面美工设计|bbs/page.asp?dex=网页前台脚本编程|bbs/page.asp?dex=网页后台脚本编程|bbs/page.asp?dex=xml与net时代编程|bbs/page.asp?dex=软件开发交流论坛|bbs/page.asp?dex=讨论区及其他学术||bbs/olduser.asp')">程式交流论坛</a> &nbsp;
</td></tr></table>
<script>
var cleartime=1
function movese(menustr,menuhref){   //添加一级菜单的函数
happydiv.style.display='';happydiv2.style.display='none';if(cleartime!=1)cleartimeout(cleartime)
happydiv.style.posleft=menutd.offsetleft+menutd1.offsetwidth+event.srcelement.offsetleft;happydiv.style.postop=menutd.offsettop+menutd.offsetheight
for(i=0;happydiv.rows.length;i++)happydiv.deleterow()    //清除一级菜单中所有单元格
str1=menustr.split('|');str2=menuhref.split('|')
for(i=0;i<str1.length;i++){        //循环给一级菜单添加单元格
tdstr=happydiv.insertrow().insertcell()
if(str1[i].indexof('**')==-1){          //如果数据可构成二级菜单则。。。

本文关键:菜单 导航栏 element offset
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top