/ Published in: JavaScript
URL: http://perpetualtechnologies.net
Returns window size as object. winsize.x = window width; winsize.y = window height;
Expand |
Embed | Plain Text
function getWindowSize(){ var x = 0; var y = 0; if (self.innerHeight) { x = self.innerWidth; y = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { x = document.documentElement.clientWidth; y = document.documentElement.clientHeight; } else if (document.body) { x = document.body.clientWidth; y = document.body.clientHeight; } return {"x":x,"y":y}; }
You need to login to post a comment.
