a标签点击页面刷新但还保存当前点击的class是激活的状态

 $(".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")
           }
          
        })

越努力,越幸运,come on!!
原文地址:https://www.cnblogs.com/huangjinmei/p/8718291.html