Created
October 24, 2012 08:21
-
-
Save imbcmdth/3944785 to your computer and use it in GitHub Desktop.
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
var width = null; | |
var height = null; | |
window.onload = function () { | |
var windowSize = getSize(); | |
width = windowSize['width']; | |
height = windowSize['height']; | |
window.onscroll = function(){ alert("Hello"); } | |
}; | |
function getSize () { | |
var winW = 630, winH = 460; | |
if (document.body && document.body.offsetWidth) { | |
winW = document.body.offsetWidth; | |
winH = document.body.offsetHeight; | |
} | |
if (document.compatMode=='CSS1Compat' && | |
document.documentElement && | |
document.documentElement.offsetWidth ) { | |
winW = document.documentElement.offsetWidth; | |
winH = document.documentElement.offsetHeight; | |
} | |
if (window.innerWidth && window.innerHeight) { | |
winW = window.innerWidth; | |
winH = window.innerHeight; | |
} | |
return { | |
'width': winW, | |
'height': winH | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment