dede如何制作下拉菜单导航
首先要调用一个javascript文件
<script type='text/javascript'
src='{dede:global.cfg_cmsurl/}/images/js/dropdown.js'></script>
然后把导航写成
<div id="nav">
<ul>
<li class="w1"><a href='{dede:global.cfg_cmsurl/}/'><p>主页</p></a></li>
{dede:channel type='top' row='10'}
<li class="w1"><a href='\[field:typeurl/\]' \[field:rel/\]><p>\[field:typename/\]</p></a></li>
{/dede:channel}
</ul>
<ul >
<div style="clear:both;"></div>
{dede:channelartlist typeid='top' cacheid='channelsonlist'}
<ul id="dropmenu{dede:field.typeid/}" class="dropMenu">
{dede:channel type='son' noself='yes'}
<li class="dropMenu"><a href="\[field:typelink/\]">\[field:typename/\]</a></li>
{/dede:channel}
</ul>
{/dede:channelartlist}
</ul>
</div>
<script type="text/javascript">cssdropdown.startchrome("nav")</script>
最后加入导航部分的css样式:
.dropMenu { background: url("https://img.paonet.com/upload-images-old/ajiaocheng/2012/0603/img/snav.jpg") repeat-x scroll 0 0 transparent; width: 1024px; height: 31px;}
.dropMenu ul li {height:16px; background:#fff}
.dropMenu li {height:16px; background:#fff}
.dropMenu a {width:auto; display: block; color:#000; padding: 2px 0 2px 2px;background:#fff}
.dropMenu a:hover {color:red; text-decoration: underline;}
从dede的这个功能我们可以看出,虽然很方便,但是dede为我考虑得太多了,对习惯自己修改程序的人来说,很不方便。