a 添加href后当前栏目如何高亮显示

//nav
$(".nav li a").each(function() {
$this = $(this);
if ($this[0].href == String(window.location)) {
$this.parent().addClass("active");
}
});

原文地址:https://www.cnblogs.com/zhouyx/p/6197303.html