首页 > CMS > Discuz > 正文

dsucuz 调用主导航

2024-09-11 09:04:32
字体:
来源:转载
供稿:网友
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}--> >        <a href="$nav[url]"{if $nav[target] == 1}  target="_blank"{/if} style="">                <!--{if $nav[logo]}-->                <img src="data/attachment/common/$nav[logo]" style=" max-width: 25px; margin: -3px -3px 0 0;"/>                <!--{/if}-->$nav[name]</a>                        <!--{if $subs}-->                                                <ul class="sub-menu">                        <!--{loop $subnavs $subnav}-->      <li>        <a href="$subnav[url]"{if $subnav[target] == 1}  target="_blank"{/if} style="">         $subnav[name]        </a>      </li>      <!--{/loop}-->    </ul>    <!--{ad/subnavbanner/a_mu}-->            <!--{/if}-->                        </li><!--{/loop}--></ul>


样式和js就不带了,网上特效很多往里套就行。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表