i have this code in include/menu.php
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li><a href="registrar_tiempo_carrera.php"><i class="glyphicon glyphicon-paperclip"></i> Registra tus tiempos de Competencias</a></li>
<li><a href="ver_tiempo_carrera.php"><i class="glyphicon glyphicon-list-alt"></i> Ver tus Marcas de Carreras</a></li>
<li><a href="agregar_amigos.php"><i class="glyphicon glyphicon-user"></i> Agrega tus Amigos</a></li>
<li><a href="ranking.php"><i class="glyphicon glyphicon-globe"></i> Rankings Generales</a></li>
<li><a href="contacto.php"><i class="glyphicon glyphicon-envelope"></i> Reportar un Problema</a></li>
</ul>
</div>
In the index.php
<body>
<?php include ('include/menu.php'); ?>
Result: http://lazaro.inf.uct.cl/~dacanalesc/registratusmarcas/
and in the menu.js put methods for set li active dynamically, but nothing work
example:
$('ul li a').click(function() {
$('ul li.active').removeClass('active');
$(this).closest('li').addClass('active');
});
my question is: with mi menu inside in another page, and in the main page include it. Require other method for put active class on li?
EDIT: Twitter Bootstrap add active class to li the first answer works for me.