jQuery - Page Component - Accordion


/ Published in: jQuery
Save to your folder(s)

jQuery - Page Component - Accordion


Copy this code and paste it in your HTML
  1. $('.accordion div.tab').on('click', function() {
  2. $(this).next().slideToggle();
  3. });
  4. $(".accordion div.tab a").on('click', function() {
  5. if ($(this).attr("class") == "active")
  6. $(this).removeClass("active");
  7. else
  8. $(this).addClass("active");
  9. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.