Definition and Usage outerWidth and outerHeight..
The outerWidth property returns the outer width of a window, including all interface elements (like toolbars/scrollbars).
The outerHeight property returns the outer height of a window, including all interface elements (like toolbars/scrollbars).
These properties are read-only
Return Value:A Number, representing the outer width and/or the outer height of the browser's window, including all interface elements, in pixels
Syntax :
window.outerWidth
window.outerHeight
Differents way how to declare outerWidth and outerHeight in program.
CODING:The outerWidth property returns the outer width of a window, including all interface elements (like toolbars/scrollbars).
The outerHeight property returns the outer height of a window, including all interface elements (like toolbars/scrollbars).
These properties are read-only
Return Value:A Number, representing the outer width and/or the outer height of the browser's window, including all interface elements, in pixels
Syntax :
window.outerWidth
window.outerHeight
Differents way how to declare outerWidth and outerHeight in program.
<!DOCTYPE html>
<html>
<body>
<p>For Internet Explorer 8, 7, 6, 5:<br>
document.documentElement.clientHeight<br>
document.documentElement.clientWidth<br>
or<br>
document.body.clientHeight<br>
document.body.clientWidth</p>
<div id="demo"></div>
<script>
var txt = "";
txt += "<b>InnerWidth: </b>" + window.innerWidth;
txt += "<b><br>InnerHeight: </b>" + window.innerHeight;
txt += "<b><br>OuterWidth: </b>" + window.outerWidth;
txt += "<b><br>OuterHeigh: </b>" + window.outerHeight;
document.getElementById("demo").innerHTML = txt;
</script>
<span></span>
</body>
</html>
<html>
<body>
<p>For Internet Explorer 8, 7, 6, 5:<br>
document.documentElement.clientHeight<br>
document.documentElement.clientWidth<br>
or<br>
document.body.clientHeight<br>
document.body.clientWidth</p>
<div id="demo"></div>
<script>
var txt = "";
txt += "<b>InnerWidth: </b>" + window.innerWidth;
txt += "<b><br>InnerHeight: </b>" + window.innerHeight;
txt += "<b><br>OuterWidth: </b>" + window.outerWidth;
txt += "<b><br>OuterHeigh: </b>" + window.outerHeight;
document.getElementById("demo").innerHTML = txt;
</script>
<span></span>
</body>
</html>
Comments
Post a Comment