code: function getWindowDimension ( $window, dimension ) {
          var doc = $window[0].document,
              property = "client" + dimension;
  
          return doc.compatMode === "BackCompat" ? doc.body[property] : doc.documentElement[property];
      }
docs: Gets the width or height of a jQuery-wrapped window. Use it instead of $container.width(). Supports quirks mode,
  unlike jQuery.
  
  Window dimensions are calculated as in Zakas, Professional Javascript (2012), p. 404. The standards mode part of
  it is the same as in jQuery, too.
  
  @param {jQuery} $window
  @param {string} dimension  "Width" or "Height" (capitalized!)
  @returns {number}