Skip to content

Instantly share code, notes, and snippets.

@bytefade
Created October 3, 2014 19:30
Show Gist options
  • Save bytefade/3b5bc4d59a45ffa07630 to your computer and use it in GitHub Desktop.
Save bytefade/3b5bc4d59a45ffa07630 to your computer and use it in GitHub Desktop.
availWidth and availHeight
function getWidth()
{
xWidth = null;
if(window.screen != null)
xWidth = window.screen.availWidth;
if(window.innerWidth != null)
xWidth = window.innerWidth;
if(document.body != null)
xWidth = document.body.clientWidth;
return xWidth;
}
function getHeight() {
xHeight = null;
if(window.screen != null)
xHeight = window.screen.availHeight;
if(window.innerHeight != null)
xHeight = window.innerHeight;
if(document.body != null)
xHeight = document.body.clientHeight;
return xHeight;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment