w3resource logo


JavaScript Window Object - outerWidth Property

JavaScript Window Object : outerWidth Property

<<PreviousNext>>

Description

The outerWidth property specifies the horizontal dimension, in pixels, of the windows's outside boundary. The outer boundary includes the scroll bars, the status bar, the tool bars, and other "chrome" (window border user interface elements).

Version

Implemented in JavaScript 1.2

Syntax

window.outerWidth

Example of Window object : outerWidth property

The following web document demonstrates how the outerWidth() property can be used.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript Window Object : outerWidth Property. Example-1</title>
</head>
<body>
<h1 style="color: red">JavaScript window Object : outerWidth Property</h1>
<h3>Clicking the following button, a new window will open with 300 pixels outerWidth and 250 pixels outerWidth.</h3>
<hr />
<script type="text/javascript">
//This is done to make the following JavaScript code compatible to XHTML. <![CDATA[
function newwindow()
{
win1=window.open(' ',' ')
win1.outerHeight = "300"
win1.outerWidth = "250"
win1.document.write("<p>We are learning outerWidth property of window object</p>");
}
//]]>
</script>
<form name="form1" action="#">
<br />
<input type="button" name="bt1" value="Open New window." onclick='newwindow()' />
</form>
</body>
</html>

View the example of window object's outerWidth property in the browser

Supported Browser

Internet Explorer 7 Firefox 3.6 Google Chrome 7 Safari 5.0.1 Opera 10
Yes Yes Yes Yes Yes

See also :

JavaScript Client side objects, methods, properties.

JavaScript Core objects, methods, properties.



<<PreviousNext>>