jquery - How to hide one element while showing another? -
i have set accordion styled q&a section on site i'm building. when click on question shows answer. want tie toggle actions when 1 question open , clicked, open 1 close , clicked 1 open.
here live example can see: http://jsfiddle.net/reevine/wmab7/
try adding $('.active').toggleclass('active').next().hide(); before $(this).toggleclass('active').. line
you might want change open class active maintain consistency. can start code $('div.toggler:not(.active)').hide();
edit:
i ended changing amount, here's link: http://jsfiddle.net/capo64/wmab7/16/
Comments
Post a Comment