$(".shop-list1").find("li").each(function(){
var href=$(this).attr("hrefs");
var hd1 = window.location.pathname;
var hd2 = window.location.search;
var href1=hd1+hd2;
var href2=href1.replace("/","");
if($(this).attr("hrefs")==href2){
$(this).addClass("active").sublings().removeClass("active")
}
})
原文地址:https://www.cnblogs.com/huangjinmei/p/8718291.html
时间: 2024-10-15 21:13:18