栏目列表中选中栏目醒目显示的方法

代码如下:

{mhcms $pid=gettopparentid($catid);}
{if $pid==0}
{mhcms $pid=$catid;}
{/if}
{mh:category parentid= $pid type= top }
<li {if field:id==$id || field:id==gettopparentid($id) } class= current {/if}><a href= {field:url} target= _self title= {field:catname} >{field:catname}</a></li>
{/mh:category}

通过{if field:id==$id || field:id==gettopparentid($id) } class= current {/if}设置选中栏目样式为current,只要在css中设置相应的样式即可醒目显示选中栏目。

专注于网络营销与SEO优化
塔铃 » 栏目列表中选中栏目醒目显示的方法

发表评论

提供最优质的资源集合

立即查看 了解详情