效果預覽:http:///keleyi/phtml/menu/1.htm
效果2:
http:///keleyi/phtml/menu/1a.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:///a/bjac/687f154f53ab3aef.htm" target="_blank">js中substring</a><br />
<a href="http:///a/bjac/ff33a0656183eba.htm" target="_blank">客戶端代碼著色</a><br />
<a href="http:///a/bjac/6e893bbacf5184f3.htm" target="_blank">js實現代碼著色</a><br />
<a href="http:///a/bjac/21e2e5321077656f.htm" target="_blank">11個js技巧</a><br />
<a href="http:///a/bjac/d32ac9822ef75ef9.htm" target="_blank">tab切換樣式</a><br />
<a href="http:///a/bjac/fca5ac722271d2d5.htm" target="_blank">js獲取可見域寬</a><br />
<a href="http:///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:///a/bjac/13639353acde40c.htm" target="_blank">左側可彈出div</a><br />
<a href="http:///a/bjac/d863921ed93d03ff.htm" target="_blank">jquery修改a標簽</a><br />
<a href="http:///a/bjac/6f008786225269ac.htm" target="_blank">純文本返回頂部</a><br />
<a href="http:///a/bjac/ac398357acb82782.htm" target="_blank">jquery倒計時</a><br />
<a href="http:///a/bjac/88af29335890a287.htm" target="_blank">div(tab)切換</a><br />
<a href="http:///a/bjac/2041333085cb032d.htm" target="_blank">選項卡切換</a><br />
<a href="http:///a/bjac/768f469b95b61487.htm" target="_blank">單行文字滾動</a><br />
<a href="http:///a/bjac/ed5eb8c2959c619e.htm" title="滾動頁面時DIV到達頂部時固定在頂部" target="_blank">DIV到頂固定</a><br />
<a href="http:///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:///a/bjac/e3ce4526c3fcaf8f.htm" target="_blank">刪除文本空白行</a><br />
<a href="http:///a/bjac/94190f87387a868a.htm" target="_blank">生成圖片驗證碼</a><br />
<a href="http:///a/bjac/954abc0d69092dc1.htm" title=".NET生成固定長度的唯一字符串(以8位為例)" target="_blank">生成唯一字符串</a><br />
<a href="http:///a/bjac/c4dd6879a4a4fb36.htm" target="_blank">向文件寫入文本</a><br />
<a href="http:///a/bjac/d09a76fa32100d7.htm" target="_blank">用IgnoreRoute忽略路徑</a><br />
<a href="http:///a/bjac/84d4e8554b88f61.htm" target="_blank">RouteCollection類</a><br />
<a href="http:///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:///a/bjac/9d5534156d5814fc.htm" target="_blank">KeleyiCMS更新</a><br />
<a href="http:///a/bjac/2916901353b081f1.htm" target="_blank">留言板介紹</a>
</div>
</li>
</ul>
</div>
</body>
</html>