Last active
August 29, 2015 14:05
-
-
Save rainyjune/9a8bad1efa7e97c3b17f to your computer and use it in GitHub Desktop.
CSS dimensions
This file contains 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
/* Firefox /NS6 properties for determining browser dimension */ | |
window.innerHeight; // Returns the physical height of the browser screen | |
window.innerWidth; // Returns the pyhsical widht of the browser screeen | |
/* IE 4+ properties for determining browser dimension */ | |
document.body.clientWidht; // Returns physical width of the browser screen | |
document.body.clientHeight; // Returns the physical height of the browser screen | |
/* Firefox / NS6+ properties for determining DSOC */ | |
window.pageXOffset; // Returns the x coordinate of the DSOC | |
window.pageYOffset; // Returns the y coordinate of the DSOC | |
/* IE 4+ properties for determining DSOC */ | |
document.body.scrollLeft; // Returns the x coordinate of the DSOC | |
document.body.scrollTop; // Returns the y coordinate of the DSOC | |
/* Document.body and doctype */ | |
var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body | |
var dsocleft=document.all? iebody.scrollLeft : pageXOffset | |
var dsoctop=document.all? iebody.scrollTop : pageYOffset | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment