Well, I'm going back here again with my question.
I got a code that would cause :hover
to be selected in the current page, but it is not working, could anyone tell me why?
Here are the codes:
<script type="text/javascript">
$(document).ready(function() {
$('li').click(function() {
$('li.active').removeClass("active"); //aqui removemos a class do item anteriormente clicado para que possamos adicionar ao item clicado
$(this).addClass("active"); //aqui adicionamos a class ao item clicado
});
});
</script>
<div id="menufundo">
<nav id="menuhorizontal">
<ul>
<li><a href="index.html" class="active">Home</a></li>
<li><a href="contato.html" class="active">Contato</a></li>
<li><a href="endereco.html" class="active">Endereço</a></li>
<li><a href="programacao.html" class="active">Programação</a></li>
</ul>
</nav>
</div>
and css:
#menuhorizontal ul li a {
padding: 2px 10px;
margin-top: 15px;
display: inline-block;
/*visual do link*/
color: #ffffff;
text-decoration: none;
}
#menuhorizontal ul li a:hover, ul li.active a {
background-color: #FFFFFF;
color: #0700fc;
border-bottom: 3px solid #0700fc;
border-radius: 10px;
color: #fff !important;
}