Skip to content

Instantly share code, notes, and snippets.

@darobin
Created June 2, 2014 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darobin/b8a9a07730e9549d1933 to your computer and use it in GitHub Desktop.
Save darobin/b8a9a07730e9549d1933 to your computer and use it in GitHub Desktop.
<button id=hide>Hide boxes</button>
<button id=show>Show boxes</button>
<script>
var $hide = $("#hide")
, $show = $("#show")
, $els = $("pre.foo")
;
function hide () {
$els.hide();
$hide.hide();
$show.show();
}
function show () {
$els.show();
$hide.show();
$show.hide();
}
$hide.click(hide);
$show.click(show);
// default to show
show();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment