Return to Snippet

Revision: 3674
at August 30, 2007 09:19 by ctran


Initial Code
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 };
}

Initial URL


Initial Description
Get the current window size.  Requires prototype.js

Initial Title
Position.getWindowSize

Initial Tags


Initial Language
JavaScript