Posted By


ctran on 08/30/07

Tagged


Statistics


Viewed 49 times
Favorited by 0 user(s)

Position.getWindowSize


/ Published in: JavaScript
Save to your folder(s)

Get the current window size. Requires prototype.js


Copy this code and paste it in your HTML
  1. Position.getWindowSize = function(w) {
  2. var width, height;
  3. w = w ? w : window;
  4. width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
  5. height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
  6.  
  7. return { width: width, height: height };
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.