addClass and removeClass kinda working? Need help fast.
Ok well i got the removeClass to work, but when i switch functions and show my other content in my div tags the addClass does not work.
Here is what i'm doing.
I have content which i'm showing and hiding. When i have one of the div tags (the content) shown i want the tabs or links that you click to show the content to be highlighted a different color when you are on that active content.
Well it works when i want to remove it as i sad earlier, but when i click the other link to show the other content that's hidden it doesn't add that class so the text is highlighted to show them they are on that correct content or tab w/e u want to call it.
Here is my jquery stuff.
-
$(document).ready(function() {
//communities
$("li.linkC").click(function() {
$('#other').hide();
$('.active').removeClass('active');
$('#communities').show();
$(this).addClass('active');
});
//other
$('li.linkO').click(function() {
$('#communities').hide();
$('a.active').removeClass('active');
$('#other').show();
$(this).addClass('active');
});
});
Not real advanced as this is my first time messing around with jQuery, but i thought this would work?
Any replies are appreciated!