Created
October 3, 2014 19:30
-
-
Save bytefade/3b5bc4d59a45ffa07630 to your computer and use it in GitHub Desktop.
availWidth and availHeight
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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