获取地址栏特定字符后面的字符
var abouturl=location.href;//获取地址
var str_after = abouturl.split("#")[1];//获取后面字符
$("li").each(function () {
var a=$(this).children().attr("href");
if(a=="#"+str_after){
$("li a").removeClass("active");
$(this).children().addClass("active")
}
});
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。