Skip to content

Instantly share code, notes, and snippets.

@chrisjung-dev
Created August 29, 2013 14:18
Show Gist options
  • Save chrisjung-dev/6378688 to your computer and use it in GitHub Desktop.
Save chrisjung-dev/6378688 to your computer and use it in GitHub Desktop.
Add basic collase to code-blocks
jQuery(document).ready(function(){
/*
Needs refinement
* at the moment, even oneliners get height 10px and will be smaller
after being clicked
* there is no clue for users that clicking will expand/collapse code sections
*/
jQuery('pre').css({height:'10em'}).toggle(
function(){jQuery(this).css({height:'auto'})},
function(){jQuery(this).css({height:'10em'})}
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment