-1
I have a menu from which when an item is selected, a div for that item appears. However, I would like that item to be marked. Trying for PHP, I did it this way:
<a href="?k=0">Todos</a>
<a href="?k=1">Alunos</a>
<a href="?k=2">Professores</a>
<a href="?k=3">Responsáveis</a>
And in PHP:
switch(isset($_GET['k'])){
case "0" : $ativo0 = "class=\"uk-active\""; break;
case "1" : $ativo1 = "class=\"uk-active\""; break;
case "2" : $ativo2 = "class=\"uk-active\""; break;
case "3" : $ativo3 = "class=\"uk-active\""; break;
default : $ativo0 = "class=\"uk-active\"";
}
No < li > for each item:
<li <?php echo $ativo0; ?>>....</li>
<li <?php echo $ativo1; ?>>....</li>
<li <?php echo $ativo2; ?>>....</li>
<li <?php echo $ativo3; ?>>....</li>
Only that it leaves marked only the $active1
put a div inside the a
– Barack