Created
August 29, 2013 14:18
-
-
Save chrisjung-dev/6378688 to your computer and use it in GitHub Desktop.
Add basic collase to code-blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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