效果预览:http://keleyi.com/keleyi/phtml/menu/1.htm
js+div+css下拉导航菜单完整代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>css+div+js下拉菜单导航--柯乐义</title> <style type="text/css"> *{margin:0;padding:0;list-style-type:none;} body{padding:0;margin:0;font-size:12px;color:#fff;font-family:arial, helvetica, sans-serif;background:#fff;} #nav{padding:0 5px;z-index:1;left:298px;width:600px;position:absolute;top:175px;height:30px;} #nav li{float:left;text-align:center;} #nav li a{float:left;width:100px;color:#336601;text-decoration:none;padding:3px 5px 0 5px;} #nav li a:hover{float:left;width:88px;color:#fff;background:#539d26;text-decoration:none;padding:3px 3px 0 20px;} .list{font-weight:normal;line-height:20px;text-align:left;padding:4px;} .menu1{border:#9cdd75 1px solid;overflow-y:hidden;margin:6px 4px 0px 0px;width:120px;cursor:pointer;color:#336601;padding-top:6px;background:#f1fbec;moz-opacity:0.7;filter:alpha(opacity=70);opacity:0.7;} .menu2{border:#eee8dd 1px solid;overflow-y:hidden;margin:6px 4px 0px 0px;width:120px;cursor:pointer;color:#999;padding-top:6px;height:18px;background:#f5f5f5;} </style> </head> <body> <div id="nav"> <ul> <li onmouseout="this.className='menu2'" onmouseover="this.className='menu1'" class="menu2">Javascript <div class="list"> <a href="http://keleyi.com/a/bjac/687f154f53ab3aef.htm" target="_blank">js中substring</a><br /> <a href="http://keleyi.com/a/bjac/ff33a0656183eba.htm" target="_blank">客户端代码着色</a><br /> <a href="http://keleyi.com/a/bjac/6e893bbacf5184f3.htm" target="_blank">js实现代码着色</a><br /> <a href="http://keleyi.com/a/bjac/21e2e5321077656f.htm" target="_blank">11个js技巧</a><br /> <a href="http://keleyi.com/a/bjac/d32ac9822ef75ef9.htm" target="_blank">tab切换样式</a><br /> <a href="http://keleyi.com/a/bjac/fca5ac722271d2d5.htm" target="_blank">js获取可见域宽</a><br /> <a href="http://keleyi.com/a/bjac/ade2f3941bd75ba.htm" target="_blank">js导航菜单</a> </div> </li> <li onmouseout="this.className='menu2'" onmouseover="this.className='menu1'" class="menu2">jQuery <div class="list"> <a href="http://keleyi.com/a/bjac/13639353acde40c.htm" target="_blank">左侧可弹出div</a><br /> <a href="http://keleyi.com/a/bjac/d863921ed93d03ff.htm" target="_blank">jquery修改a标签</a><br /> <a href="http://keleyi.com/a/bjac/6f008786225269ac.htm" target="_blank">纯文本返回顶部</a><br /> <a href="http://keleyi.com/a/bjac/ac398357acb82782.htm" target="_blank">jquery倒计时</a><br /> <a href="http://keleyi.com/a/bjac/88af29335890a287.htm" target="_blank">div(tab)切换</a><br /> <a href="http://keleyi.com/a/bjac/2041333085cb032d.htm" target="_blank">选项卡切换</a><br /> <a href="http://keleyi.com/a/bjac/768f469b95b61487.htm" target="_blank">单行文字滚动</a><br /> <a href="http://keleyi.com/a/bjac/ed5eb8c2959c619e.htm" title="滚动页面时DIV到达顶部时固定在顶部" target="_blank">DIV到顶固定</a><br /> <a href="http://keleyi.com/a/bjac/a6d651710217f7a0.htm" title="使用jQuery UI修饰title属性的气泡悬浮框" target="_blank">修饰title气泡</a> </div> </li> <li onmouseout="this.className='menu2'" onmouseover="this.className='menu1'" class="menu2">C# <div class="list"> <a href="http://keleyi.com/a/bjac/e3ce4526c3fcaf8f.htm" target="_blank">删除文本空白行</a><br /> <a href="http://keleyi.com/a/bjac/94190f87387a868a.htm" target="_blank">生成图片验证码</a><br /> <a href="http://keleyi.com/a/bjac/954abc0d69092dc1.htm" title=".NET生成固定长度的唯一字符串(以8位为例)" target="_blank">生成唯一字符串</a><br /> <a href="http://keleyi.com/a/bjac/c4dd6879a4a4fb36.htm" target="_blank">向文件写入文本</a><br /> <a href="http://keleyi.com/a/bjac/d09a76fa32100d7.htm" target="_blank">用IgnoreRoute忽略路径</a><br /> <a href="http://keleyi.com/a/bjac/84d4e8554b88f61.htm" target="_blank">RouteCollection类</a><br /> <a href="http://keleyi.com/a/bjac/c8e988b2eb520f4b.htm" target="_blank">柯乐义图片压缩类</a> </div> </li> <li onmouseout="this.className='menu2'" onmouseover="this.className='menu1'" class="menu2">CMS <div class="list"><a href="http://keleyi.com/a/bjac/9d5534156d5814fc.htm" target="_blank">KeleyiCMS更新</a><br /> <a href="http://keleyi.com/a/bjac/2916901353b081f1.htm" target="_blank">柯乐义留言板介绍</a> </div> </li> </ul> </div> </body> </html>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>