首先写一个CSS样式
.zb { list-style:none; text-align:left; position:absolute; z-index:99999; margin:0px; padding:0px !important; top:37px; left:0px; background:#009900; width:130px; display:none }.zb li{ text-align:left ; line-height:30px !important; height:30px; width:130px; }.r{ margin-left:10px; font-weight:normal}.nav_cc li{ float:left;line-height:37px; font-weight:bold; color:#fff; font-family:黑体;}.nav_cc ul{ padding-left:20px}.nav_cc li a:link,.nav_cc li a:visited{ font-size:14px; color:#fff; margin:auto 15px}.nav_cc li a:hover{ color:#f00}.hover{color:#f00}
前端导航调用
<SCRIPT src=".min.js"></SCRIPT> //引入要用的js<div class="nav_cc" style="overflow:inherit"><ul id="shanmao"><li><a href='{dede:global.cfg_cmsurl/}/'><span>主页</span></a> |</li>{dede:channelartlist row=8}<li style="position:relative;"><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a> |<ul class="zb">{dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0,17'}<li><a href='/plus/list.php?tid=[field:id/]' style="font-weight:normal">[field:typename/]</a></li>{/dede:sql}</ul></li>{/dede:channelartlist}</ul></div>
下拉菜单执行代码
<script>$(document).ready(function(){$("#shanmao li").hover(function(){$(this).children(".zb").slideDown(1000);},function(){$(this).children(".zb").slideUp(0);});});</script>
前端的朋友可以根据自己的需求去写自代码。