Skip to content

Instantly share code, notes, and snippets.

@egrouse
Created March 15, 2012 18:32
Show Gist options
  • Save egrouse/2045890 to your computer and use it in GitHub Desktop.
Save egrouse/2045890 to your computer and use it in GitHub Desktop.
jquery is cool
$(document).ready( function(){
// Do the hidy boxes
$('a.toggle-box').click( function(){
var rel = $(this).attr( 'rel' ),
section = $( 'section#' + rel ),
target = section.find( '.box' );
if( section.hasClass( 'hidden' ) )
{
target.slideDown();
section.removeClass( 'hidden' );
}
else
{
target.slideUp();
section.addClass( 'hidden' );
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment