实现dedeCMS二级导航的简单方法
2013-08-09 11:52:35 来源:WEB开发网核心提示: 导航代码<ul id="topmenue"> <li class="first" id="mn_portal"><a href="/" hidefocus="true" title=
导航代码
<ul id="topmenue"> <li class="first" id="mn_portal"><a href="/" hidefocus="true" title="Portal">网站首页<span>Portal</span></a></li> {dede:channelartlist typeid={dede:field.typeid/} <li id="mn_N5f30" onmouseover="t('{dede:field name='typeid'/}');" onmouseout="f('{dede:field name='typeid'/}');" name="{dede:field name='typeid'/}"> <a href="{dede:field name='typeurl'/}" [field:rel/] >{dede:field name='typename'/}</a> <ul id="snav" name="{dede:field.typeid/}"> {dede:channel type='son' noself='yes'} <li style="display:block;height:40px;margin:0;padding:0;clear:both;background:none;text-align:cnetent;line-height:40px;background:#F4FBF4;"><a href="[field:typelink /]" >[field:typename /]</a></li> {/dede:channel} </ul> </li> {/dede:channelartlist} </ul>
在添加一段js代码
<script type="text/javascript"> function t(id) { var dul = document.getElementsByName(id); var fu = dul[1]; fu.style.display = "block"; } function f(id) { var dul = document.getElementsByName(id); var fu = dul[0]; var lu = fu.childNodes[3]; lu.style.display = "none"; } </script>
赞助商链接