Skip to content

Instantly share code, notes, and snippets.

@Oshuma
Created July 2, 2009 01:49
Show Gist options
  • Select an option

  • Save Oshuma/139219 to your computer and use it in GitHub Desktop.

Select an option

Save Oshuma/139219 to your computer and use it in GitHub Desktop.
Simple ass jQuery accordion effect.
<!-- Add a class to the link and info elements. -->
<li>
<a class="show-info" href="#">Show The Element</a>
<div class="info" style="display: none;">
Some content here.
</div>
</li>
<!-- etc. -->
$(document).ready(function() {
// Attach this to the link elements.
$('.show-info').click(function() {
var info = $(this).siblings('.info');
$('.info').slideUp('fast'); // Hide the other info divs.
info.slideDown('fast');
return false;
});
}); // $(document).ready()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment