Skip to content

Instantly share code, notes, and snippets.

@o4tuna
Created October 27, 2015 19:11
Show Gist options
  • Save o4tuna/5be09a003d0fe299466d to your computer and use it in GitHub Desktop.
Save o4tuna/5be09a003d0fe299466d to your computer and use it in GitHub Desktop.
<html>
<head>
<title>reveal_hidden_div_and_flash_it.html</title>
<style>
@keyframes flash {
to {background-color: lemonChiffon;}
}
div#my_division {
display: none;
animation: flash 3s ease 250ms 1;
}
div#my_division {
margin: 3rem;
padding: 2rem;
}
</style>
<script>
function showHideElement(box,id) {
var elm = document.getElementById(id)
elm.style.display = box.checked? "none" : "block";
}
</script>
</head>
<body>
<input id="chkIsHidden" type="checkbox" checked value="" onClick="showHideElement(this,'my_division')">&nbsp;Hide my_division
<div id="my_division">
<p>Howdy, I'm my_division!</p>
<p>Peek-a-boo!</p>
</div>
<body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment