Skip to content

Instantly share code, notes, and snippets.

@mgalardini
Last active August 29, 2015 14:13
Show Gist options
  • Save mgalardini/9834c1a5c9a78c74620b to your computer and use it in GitHub Desktop.
Save mgalardini/9834c1a5c9a78c74620b to your computer and use it in GitHub Desktop.
Toggle code cells in ipython html notebooks
<script type="text/javascript"> show=true; function toggle(){ if (show){ $('div.input').hide(); }else{ $('div.input').show(); } show = !show } if(window.attachEvent) { window.attachEvent('onload', toggle); } else { if(window.onload) { var curronload = window.onload; var newonload = function() { curronload(); toggle(); }; window.onload = newonload; } else { window.onload = toggle; } } </script>

Toggle source code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment