导航栏目菜单高亮显示
未知
2021-07-03 11:08:27
0次
<li class="layui-nav-item {if condition="$Request.controller=='Client'"}layui-nav-itemed{/if}">
<a href="javascript:;">
<span class="iconfont icon-kehu"></span>
<cite>客户管理</cite>
{if condition="$clientsupscript.sum>0"}<span class="layui-badge-dot"></span>{/if}
</a>
<dl class="layui-nav-child">
<dd class="nav-child">
<a title="客户管理" href="__MODULE__/client/index">客户管理<span class="layui-badge layui-bg-orange">{$clientsupscript.sum}</span></a>
</dd>
</dl>
</li>
<li class="layui-nav-item {if condition="$Request.controller=='Product'"}layui-nav-itemed{/if}">
<a href="javascript:;">
<span class="iconfont icon-chanpin"></span>
<cite>产品管理</cite>
</a>
<dl class="layui-nav-child">
<dd class="nav-child"><a title="产品库" href="__MODULE__/product/index">产品库</a></dd>
</dl>
</li>
<script type="text/javascript">
// 当前菜单设置高亮父栏目设置显示
url = window.location.pathname;
$(".nav-child").children('a').each(function(index, value) {
apath=value.href.substring(27);
title=value.title;
if(apath==url){
$(".breadcrumb-child-title").text(title);
$(this).parent().addClass('layui-this');
$(this).parents('li').addClass('layui-nav-itemed').siblings('.layui-nav-item').removeClass('layui-nav-itemed');
}
});
</script>
相关内容