jquery active menu issue for links -
hi use event check active menu in navigation
window.addeventlistener("load",function(){ var mylinks = document.queryselectorall(".main-navigation-menu a"); for(var i=0; i<mylinks.length; i++) if(location.href==mylinks[i].href) mylinks[i].parentnode.classlist.add("active"); }); and work correct main links e.x mysite.com/users , mysite.com/settings ..., when go e.x mysite.com/users/add active menu disappear... idea how fix stay active menu class permalinks.
thanks.
wiki
Comments
Post a Comment