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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -