Posted By

cfleschhut on 08/16/09


Tagged

jquery accordion


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Onfire60


jQuery Accordion


 / Published in: jQuery
 

URL: http://jsbin.com/ukuti

inspired by boagworld.com

  1. $("dd:not(:first)").hide();
  2. $("dt a").click(function() {
  3. if ($(this).parent().next().is(":hidden")) {
  4. $("dd:visible").slideUp();
  5. $(this).parent().next().slideDown();
  6. }
  7. return false;
  8. });
  9.  
  10.  
  11. // HTML:
  12. // <dl>
  13. // <dt><a href="#">definition term</a></dt>
  14. // <dd>definition description</dd>
  15. // <dt><a href="#">definition term</a></dt>
  16. // <dd>definition description</dd>
  17. // <dt><a href="#">definition term</a></dt>
  18. // <dd>definition description</dd>
  19. // </dl>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: cfleschhut on August 17, 2009

well, yeah… just found this: http://docs.jquery.com/Tutorials:AccordionMenu%28Screencast%29 %-)

You need to login to post a comment.