Skip to content

Instantly share code, notes, and snippets.

@tang9ian
Created September 17, 2013 07:16
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 tang9ian/6590976 to your computer and use it in GitHub Desktop.
Save tang9ian/6590976 to your computer and use it in GitHub Desktop.
<script>
function resizeElementHeight(element) {
var height = 0;
var body = window.document.body;
if (window.innerHeight) {
height = window.innerHeight;
} else if (body.parentElement.clientHeight) {
height = body.parentElement.clientHeight;
} else if (body && body.clientHeight) {
height = body.clientHeight;
}
element.style.height = ((height - element.offsetTop) + "px");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment