may88seiji
7/17/2017 - 3:17 PM

accordion

accordion

<dl class="accordion">
  <dt>title 1</dt>
  <dd>contents 1 ...</dd>
  <dt>title 2</dt>
  <dd>contents 2 ...</dd>
  <dt>title 3</dt>
  <dd>contents 3 ...</dd>
</dl>
$('.accordion dd').hide();
$('.accordion dt').css('cursor', 'pointer').on('click', function() {
  // $('.accordion dt').removeClass('is-open');
  // $('.accordion dd').stop().slideUp();
  $(this).toggleClass('is-open');
  $(this).next().stop().slideToggle();
});