From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/pt-br/web/api/window/innerheight/index.html | 137 ++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 files/pt-br/web/api/window/innerheight/index.html (limited to 'files/pt-br/web/api/window/innerheight') diff --git a/files/pt-br/web/api/window/innerheight/index.html b/files/pt-br/web/api/window/innerheight/index.html new file mode 100644 index 0000000000..5caf8ae916 --- /dev/null +++ b/files/pt-br/web/api/window/innerheight/index.html @@ -0,0 +1,137 @@ +--- +title: Window.innerHeight +slug: Web/API/Window/innerHeight +translation_of: Web/API/Window/innerHeight +--- +
{{APIRef}}
+ +

Altura (em pixels) da janela de visualização do navegador, incluindo, se renderizado, a barra de rolagem horizontal.

+ +
Note: If you use {{ifmethod("nsIDOMWindowUtils", "setCSSViewport")}} to set the virtual window size for page layout purposes, the value returned by this property corresponds to the viewport height set using that method.
+ +

Syntax

+ +
var intViewportHeight = window.innerHeight;
+ +

Value

+ +

On return, intViewportHeight is the height of the browser window's viewport.

+ +

The window.innerHeight property is read only; it has no default value.

+ +

Notes

+ +

The innerHeight property is supported in any window object like a {{domxref("window")}}, a frame, a frameset, or a secondary window.

+ +

There is an algorithm to obtain the height of the viewport excluding, if rendered, the horizontal scrollbar.

+ +

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
+
+ +

{{todo("link to an interactive demo here")}}

+ +

To change the size of a window, see {{domxref("window.resizeBy()")}} and {{domxref("window.resizeTo()")}}.

+ +

To get the outer height of a window, i.e. the height of the whole browser window, see {{domxref("window.outerHeight")}}.

+ +

Graphical example

+ +

The following figure shows the difference between outerHeight and innerHeight.

+ +

innerHeight vs outerHeight illustration

+ +

Specification

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSSOM View', '#dom-window-innerheight', 'window.innerHeight')}}{{Spec2('CSSOM View')}}Initial definition
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support1{{CompatVersionUnknown}}{{CompatGeckoDesktop(1.0)}}[1]993
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support1{{CompatVersionUnknown}}{{CompatGeckoMobile(1.0)}}[1]993
+
+ +

[1] From Firefox 4 to 24 this property was buggy and could give a wrong value before page load on certain circumstances, see {{bug(641188)}}.

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf