ace admin 左侧菜单定位

来源:互联网 发布:windows图形界面编程 编辑:程序博客网 时间:2024/04/28 17:13

不知道怎么定位,左侧菜单,于是自己写了段JS通过URL来控制,如下:

<script>

var pathname = window.location.pathname;

$("li a").each(function() {

varhref = $(this).attr("href");

if(pathname == href){

$(this).parents("ul").parent("li").addClass("active");

$(this).parent("li").addClass("active");

}

});

</script>


1 0