Created
May 18, 2015 16:37
-
-
Save mgalardini/84639f47a984fc0e930d to your computer and use it in GitHub Desktop.
Ipython notebook html template for code cells toggling
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
{% extends 'full.tpl' %} | |
{% block header %} | |
{{ super() }} | |
<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> | |
{% endblock header %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment