Skip to content

Instantly share code, notes, and snippets.

@BDFife
Created November 27, 2012 23:53
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 BDFife/4158029 to your computer and use it in GitHub Desktop.
Save BDFife/4158029 to your computer and use it in GitHub Desktop.
Show/Hide CSS
<html>
<head>
<script language=javascript type='text/javascript'>
function toggle_visiblity(id) {
var e = document.getElementById(id);
if (e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
</script>
</head>
<body>
<h1> Show/Hide Example: </h1>
<p><a href="javascript:toggle_visibility('boo')"> Click here. </a></p>
<div id="boo" style="display:none;">
<p> Amazing hiding and re-appearing text! </p>
</div>
</body>
</html>
http://css-tricks.com/snippets/javascript/showhide-element/
http://www.willmaster.com/blog/css/show-hide-div-layer.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment