Return to Snippet

Revision: 16796
at December 1, 2009 05:54 by cfleschhut


Updated Code
$("dd:not(:first)").hide();
$("dt a").click(function() {
  if ($(this).parent().next().is(":hidden")) {
    $("dd:visible").slideUp();
    $(this).parent().next().slideDown();
  }
  return false;
});


// HTML:
// <dl>
//   <dt><a href="#">definition term</a></dt>
//   <dd>definition description</dd>
//   <dt><a href="#">definition term</a></dt>
//   <dd>definition description</dd>
//   <dt><a href="#">definition term</a></dt>
//   <dd>definition description</dd>
// </dl>

Revision: 16795
at August 17, 2009 07:41 by cfleschhut


Updated Code
$("dd:not(:first)").hide();
  $("dt a").click(function() {
    if ($(this).parent().next().is(":hidden")) {
      $("dd:visible").slideUp();
      $(this).parent().next().slideDown();
    }
    return false;
  });


// HTML:
// <dl>
//   <dt><a href="#">definition term</a></dt>
//   <dd>definition description</dd>
//   <dt><a href="#">definition term</a></dt>
//   <dd>definition description</dd>
//   <dt><a href="#">definition term</a></dt>
//   <dd>definition description</dd>
// </dl>

Revision: 16794
at August 16, 2009 13:40 by cfleschhut


Updated Code
$("dd:not(:first)").hide();
$("dt").mouseover(function() {
	if ($(this).next().is(":hidden")) {
		$("dd").slideUp();
		$(this).next().slideDown();
	}
});

// HTML:
// <dl>
// 	<dt>definition term</dt>
// 	<dd>definition description</dd>
// 	<dt>definition term</dt>
// 	<dd>definition description</dd>
// 	<dt>definition term</dt>
// 	<dd>definition description</dd>
// </dl>

Revision: 16793
at August 16, 2009 13:37 by cfleschhut


Initial Code
$("dd:not(:first)").hide();
$("dt").mouseover(function() {
	if ($(this).next().is(":hidden")) {
		$("dd").slideUp();
		$(this).next().slideDown();
	}
});

Initial URL
http://jsbin.com/ukuti

Initial Description
inspired  by boagworld.com

Initial Title
jQuery Accordion

Initial Tags
jquery

Initial Language
jQuery