How to use window object outerWidth and outerHeight in JavaScript

In this article i am going to explain about outerWidth and outerHeight of JavaScript.
  • 1761

OuterWidth and OuterHeight  property in JavaScript window object

The outerWidth and outerHeight properties determine the dimensions, in pixels, if the outside boundary, including all interface elements, of a window.


Syntax of OuterWidth and OuterHeight   property

window.outerWidth
window.outerHeight


Browser support

The outerWidth and outerHeight   property is supported in all major browser.

Example of  OuterWidth and OuterHeight  property

<!DOCTYPE html>

<html>

<head>

<title>JavaScript Window Object : OuterHeight Property. Example-1</title>

</head>

<body>

<h1 style="color:blue">OuterHeight and outerWidth Property</h1>

<script type="text/javascript">

    function newwindow() {

        win1 = window.open(' ', ' ')

        win1.outerHeight = "300"

        win1.outerWidth = "250"

        win1.document.write("<p>Here OuterHeight and OuterWidth property of window object</p>");

    }

</script>

<form name="form1" action="#">

<br />

<input type="button" name="bt1" value="Click Here for new window." onclick='newwindow()' />

</form>

</body>

</html>


Output:

outerheight and outerwidth property.jpg

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.