Packagecssom.view
Interfacepublic interface WindowView
Implementors Window

Introduced in: DOM 0 
Modified in: HTML 5 

Has properties that hold the dimensions of the entire browser window.

Some browser compatibility information was obtained via Quirksmode.

Some browser compatibility information was obtained via Aptana.

See also

W3C CSSOM Views Specification: WindowView
Quirksmode: W3C DOM Compatibility - CSS Object Model View


Public Properties
 PropertyDefined By
  CSSOM View innerHeight : Number
[read-only] Height of the browser window viewport including, if rendered, the horizontal scrollbar.
WindowView
  CSSOM View innerWidth : Number
[read-only] Width of the browser window viewport including, if rendered, the vertical scrollbar.
WindowView
  CSSOM View media : Media
[read-only] Returns an Media object.
WindowView
  CSSOM View outerHeight : Number
[read-only] Gets the height of the outside of the browser window.
WindowView
  CSSOM View outerWidth : Number
[read-only] Gets the width of the outside of the browser window.
WindowView
  CSSOM View pageXOffset : Number
[read-only] Returns the number of pixels that the document has already been scrolled horizontally.
WindowView
  CSSOM View pageYOffset : Number
[read-only] Returns the number of CSS pixels the user has scrolled towards the bottom within the viewport.
WindowView
  CSSOM View screen : Screen
[read-only] Returns a reference to the screen object associated with the window.
WindowView
  CSSOM View screenX : Number
[read-only] Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
WindowView
  CSSOM View screenY : Number
[read-only] Returns the vertical distance of the top border of the user's browser from the top edge of the screen.
WindowView
Property Detail
CSSOM View innerHeightproperty
innerHeight:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Height of the browser window viewport including, if rendered, the horizontal scrollbar.

Note: The innerHeight property will be supported in any window object like a window, a frame, a frameset or a secondary window.


Implementation
    public function get innerHeight():Number

See also


Example
Assuming a frameset
         var intFrameHeight = window.innerHeight; // or
         var intFrameHeight = self.innerHeight; // will return the height of the frame viewport within the frameset
         var intFramesetHeight = parent.innerHeight; // will return the height of the viewport of the closest frameset
         var intOuterFramesetHeight = top.innerHeight; // will return the height of the viewport of the outermost frameset
CSSOM View innerWidthproperty 
innerWidth:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Width of the browser window viewport including, if rendered, the vertical scrollbar.

Note: The innerWidth property does not include the sidebar. So when the sidebar is expanded, the innerWidth property value diminishes.

Note: The innerWidth property will be supported in any window object like a window, a frame, a frameset or a secondary window.


Implementation
    public function get innerWidth():Number

See also


Example
Assuming a frameset
         var intFrameWidth = window.innerWidth; // or
         var intFrameWidth = self.innerWidth; // will return the width of the frame viewport within the frameset
         var intFramesetWidth = parent.innerWidth; // will return the width of the viewport of the closest frameset
         var intOuterFramesetWidth = top.innerWidth; // will return the width of the viewport of the outermost frameset
CSSOM View mediaproperty 
media:Media  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: HTML 5 

Returns an Media object.


Implementation
    public function get media():Media

See also

CSSOM View outerHeightproperty 
outerHeight:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Gets the height of the outside of the browser window. window.outerHeight represents the height of the whole browser window including toolbars and window chrome.


Implementation
    public function get outerHeight():Number

See also

CSSOM View outerWidthproperty 
outerWidth:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Gets the width of the outside of the browser window. window.outerWidth represents the width of the whole browser window including sidebar (if expanded), window chrome and window [re-]sizing borders/handles.


Implementation
    public function get outerWidth():Number

See also

CSSOM View pageXOffsetproperty 
pageXOffset:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Returns the number of pixels that the document has already been scrolled horizontally.

Note: window.pageXOffset == window.scrollX; // always true


Implementation
    public function get pageXOffset():Number

See also


Example
         // make sure and go over to the second horizontal page
         if (window.scrollX) {
             scroll(0,0);
         }
         scrollBy(400, 0);
CSSOM View pageYOffsetproperty 
pageYOffset:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Returns the number of CSS pixels the user has scrolled towards the bottom within the viewport.

Note: window.pageYOffset == window.scrollY; // always true


Implementation
    public function get pageYOffset():Number

See also


Example
         // make sure and go over to the second horizontal page
         if (window.scrollY) {
             scroll(0,0);
         }
         scrollByPages(1);
CSSOM View screenproperty 
screen:Screen  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Returns a reference to the screen object associated with the window.


Implementation
    public function get screen():Screen

See also


Example
         if (screen.pixelDepth < 8) {
             // use low-color version of page
         } else { 
             // use regular, colorful page
         }
CSSOM View screenXproperty 
screenX:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Returns the horizontal distance of the left border of the user's browser from the left side of the screen.

Note (Opera): Opera calculates the coordinates of the specific tab window relative to the encompassing browser window. This is understandable given its way of working with windows, but strictly speaking it's a bug. It should give the coordinates of the encompassing browser window relative to the screen.


Implementation
    public function get screenX():Number

See also

CSSOM View screenYproperty 
screenY:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 
Modified in: HTML 5 

Returns the vertical distance of the top border of the user's browser from the top edge of the screen.

Note (Opera): Opera calculates the coordinates of the specific tab window relative to the encompassing browser window. This is understandable given its way of working with windows, but strictly speaking it's a bug. It should give the coordinates of the encompassing browser window relative to the screen.


Implementation
    public function get screenY():Number

See also