Your Ad Here

Posted By

ctran on 08/30/07


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

hans


Position.getWindowSize


 / Published in: JavaScript
 

Get the current window size. Requires prototype.js

  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  

You need to login to post a comment.