Skip to content

Instantly share code, notes, and snippets.

@rodcisal
Created July 5, 2013 14:44
Show Gist options
  • Save rodcisal/5935024 to your computer and use it in GitHub Desktop.
Save rodcisal/5935024 to your computer and use it in GitHub Desktop.
activar clase de elemento en navigation bar
(function activarClase () {
aObj = document.getElementById('nav').getElementsByTagName('a');
for(i=0; i< aObj.length; i++) { if (document.location.href.indexOf( aObj[i].href )>=0 ) { aObj[i].parentNode.className = 'mini-bloque activo'; } }
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment