I have written a jquery script here
But there is problem in the $(this).toggleClass("active").next();
section. With this all the header tags will be in "active" class. How can I assign "active" class only for clicked tag?
Thanks in advance
views:
27answers:
1
+4
A:
You can remove it from the previously clicked headers by calling .removeClass()
on the .siblings()
, like this:
$(this).toggleClass("active").siblings().removeClass("active");
Nick Craver
2010-10-19 20:30:50