UPDATE: link to the site http://lucasvallim.com/previews/example/servicos.html
I need to remove all the IDs of every .item_index li on the div and afterwards add the id #servico_ativo to the one that was clicked.
It only works once, the other clicks will just add the ID to the clicked link and will not remove the IDs anymore...
OR, if possible, another solution would be to use class instead of id. but in this case, i would have to remove only the class "servico_ativo" from all the li items, and then add this same class to the clicked item.
the id "servico_ativo" adds a css to get the fonts bold and also a background to the li item that the user clicked.. it's quite simple but i'm not so good with jquery yet.
All solutions are welcome.
Any suggestion?
$("a.click_assessoria").click(function(){
$(".conteudo_dinamico").empty()
$.get('assessoria.html', function(result) {
$('.conteudo_dinamico').append(result);
});
$(".item_index").removeAttr("id");
$(this).attr('id', 'servico_ativo');
});
$("a.click_projeto").click(function(){
$(".conteudo_dinamico").empty()
$.get('projeto.html', function(result) {
$('.conteudo_dinamico').append(result);
});
$(".item_index").removeAttr("id");
$(this).attr('id', 'servico_ativo');
});
$("a.click_instalacao").click(function(){
$(".conteudo_dinamico").empty()
$.get('instalacao.html', function(result) {
$('.conteudo_dinamico').append(result);
});
$(".item_index").removeAttr("id");
$(this).attr('id', 'servico_ativo');
});