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

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -