/ Published in: JavaScript
Get the current window size. Requires prototype.js
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Position.getWindowSize = function(w) { var width, height; w = w ? w : window; width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth); height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight); return { width: width, height: height }; }