Hello guys, im new to jquery, i got this code from another site, and i dont know how to change it properly.
-
$(function(){
var menus = $("#individuals, #institutions");
menus.click(function(){
menus.not(this).removeClass("menu_ativo_english");
$(this).toggleClass("menu_ativo_english");
});
});
PS: "#individuals" and "#institutions" are the menu id's.
"menu_ativo_english" is the class that i used to change the background of the current ID.
im using this to change the background of my top menu. But when i click twice the menu just change it back instead of staying the same when i click in the same item twice.
I dont know how to get the ID i clicked and check if it is the same i clicked again(then the background wont change).
I dont know if i explained well, but if you can help me ill be gratefull.
Thanks!