Skip to content

Instantly share code, notes, and snippets.

@SpencerCooley
Created May 10, 2012 20:20
Show Gist options
  • Select an option

  • Save SpencerCooley/2655643 to your computer and use it in GitHub Desktop.

Select an option

Save SpencerCooley/2655643 to your computer and use it in GitHub Desktop.
$('#show_icon').click(function(){
$(this).hide();
$('#hide_icon').show();
$(this).parent().parent().find('div[class^="content_box_one"]').slideDown('slow');
$.cookie('content_box_one', 'extended');
})
$('hide_icon').click(function(){
$(this).hide();
$('#show_icon').show();
$(this).parent().parent().find('div[class^="content_box_one"]').slideUp('slow');
$.cookie('content_box_one', 'collapsed');
});
if($.cookie('content_box_one') == 'extended'){
$('.content_box_one').show();
}
else{
$('.content_box_one').hide();
}
//this could be done for any number of boxes. Didn't test it out but seems like it should work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment