广告位招租 qq245909083

dsucuz 调用主导航

分享时间:2018-09-11 1511 热度℃
discuz默认的主导航样式不好自定义,再有当主导航固定时下拉的菜单不跟随滚动。

下面的代码可以自己查询调用,样式和特效自由度高一些。
<ul id="menu-navigation" class="menu">
<!--{eval $navs = DB::fetch_all("SELECT * FROM ".DB::table('common_nav')." WHERE `available` > 0 and `navtype` = 0 and `parentid` = 0 ORDER BY `displayorder` ASC");}-->
<!--{loop $navs $nav}-->
<!--{eval $subnavs = DB::fetch_all("SELECT * FROM ".DB::table('common_nav')." WHERE `available` > 0 and `navtype` = 0 and `parentid` = $nav[id] ORDER BY `displayorder` ASC");}-->
<!--{eval $subs = DB::result(DB::query("SELECT name FROM ".DB::table('common_nav')." WHERE available > '0' and navtype = '0' and parentid = '$nav[id]'"));}-->
<li<!--{if $subs}--> class="current-menu-parent menu-item-has-children"<!--{/if}--> >
&#160; &#160;&#160; &#160;&#160;&#160;<a href="$nav[url]"{if $nav[target] == 1}&#160;&#160;target="_blank"{/if} style="">
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{if $nav[logo]}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <img src="data/attachment/common/$nav[logo]" style=" max-width: 25px; margin: -3px -3px 0 0;"/>
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{/if}-->$nav[name]</a>&#160; &#160;&#160; &#160;&#160;&#160;
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{if $subs}-->&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160;&#160;
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <ul class="sub-menu">
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;<!--{loop $subnavs $subnav}-->
&#160; &#160;&#160; &#160;<li>
&#160; &#160;&#160; &#160;&#160;&#160;<a href="$subnav[url]"{if $subnav[target] == 1}&#160;&#160;target="_blank"{/if} style="">
&#160; &#160;&#160; &#160;&#160; &#160;$subnav[name]
&#160; &#160;&#160; &#160;&#160;&#160;</a>
&#160; &#160;&#160; &#160;</li>
&#160; &#160;&#160; &#160;<!--{/loop}-->
&#160; &#160; </ul>
&#160; &#160; <!--{ad/subnavbanner/a_mu}-->&#160; &#160;&#160; &#160;&#160;&#160;
&#160; &#160; <!--{/if}-->&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;
</li>
<!--{/loop}-->
</ul>
复制代码

样式和js就不带了,网上特效很多往里套就行。
文章标题:dsucuz 调用主导航

本文地址:http://www.aizhanku.com/t37766

本文标签:
返回顶部