When i click a link the first time everything seems to be ok..
When i click for second time background-color of this li changed li font takes opacity 0.5,
previous li hasn't active className but previous li text hasn't go to opacity:1
Any help?

1 Answer
1

As it was said, using $("#menu .active").removeClass("active"); is more correct than removing the entire class attribute was you did, as you may ending losing other classes you may have, thus resulting in unexpected behavior.

why this: $("#menu .active").removeClass("active").find("a").css("opacity",1); works but this: $("#menu .active").removeClass("active"); not?? The class change in any case but only opacity change in the first code
–
Chris PNov 27 '11 at 12:21