discuz二级、三级导航高亮,文章内容页跟随三级导航高亮的方法
查找<!--{eval $mnid = getcurrentnav();}-->
改成
<!--{eval $mnid = getcurrentnav();}-->
<!--{if $mnid=='mn_portal'&&$cats}-->
<!--{loop $_G['setting']['navs'] $k $v}-->
<!--{if $v['navname'] == $cats}-->
{eval $mnid = $v['navid'];}
{eval break;}
<!--{/if}-->
<!--{/loop}-->
<!--{/if}-->
-----------------------
查找
<div id="mu" class="cl">
<!--{if $_G['setting']['subnavs']}-->
<!--{loop $_G $navid $subnav}-->
<!--{if $_G['setting']['navsubhover'] || $mnid == $navid}-->
<ul class="cl {if $mnid == $navid}current{/if}" id="snav_$navid" style="display:{if $mnid != $navid}none{/if}">
$subnav
</ul>
<!--{/if}-->
<!--{/loop}-->
<!--{/if}-->
</div>
下面加入
<!--{if CURSCRIPT=='portal'&&$cats}-->
<script type="text/javascript">
(function (){
var cat_name = "{$cats}",
css = 'style="color:red;"',html="",pos=0,pos2=0,str1="",str2="";
if(!cat_name)cat_name = "{$cat['catname']}";
if(cat_name&&$('snav_{$mnid}')){
html = $('snav_{$mnid}').innerHTML;
$('snav_{$mnid}').innerHTML = html.replace('>'+cat_name,css+' >'+cat_name);
}
})();
</script>
<!--{/if}-->
-----------------
增加三级导航输出
可以加在
</div>
<!--{ad/subnavbanner/a_mu}-->
上面去
<!--{if CURSCRIPT=='portal'&&$cats}-->
<!--{if $cat['subs']}-->
{eval $_cat_data =&$cat['subs'];}
<!--{elseif $cat&&!$cat}-->
{eval $_cat_data =&$cat['others'];}
<!--{/if}-->
<!--{if $_cat_data}-->
<ul class="cl current">
<!--{loop$_cat_data $k $v}-->
<li><a href="{$v['caturl']}"{if $_G['catid']==$v['catid'] || $article['catid']==$v['catid']} style="color:red;"{/if}>{$v['catname']}</a></li>
<!--{/loop}-->
</ul>
<!--{/if}-->
<!--{/if}-->
修改高亮颜色 上一步代码里面的
style="color:red;"
如果自身有CSS
可以把 style="color:red;" 改成 class="你的CSS类名"
页:
[1]