VisualViewport class
The interface of the Visual Viewport API represents the visual
viewport for a given window. For a page containing iframes, each
iframe, as well as the containing page, will have a unique window
object. Each window on a page will have a unique representing the
properties associated with that window.
You can get a window's visual viewport using
Window.visualViewport
.
Note: Only the top-level window has a visual viewport that's
distinct from the layout viewport. Therefore, it's generally only
the object of the top-level window that's useful. For an
<iframe>
, visual viewport metrics like VisualViewport.width
always correspond to layout viewport metrics like
document.documentElement.clientWidth
.
EventTarget
VisualViewport
- Implemented types
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
- VisualViewport()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Available on VisualViewport, provided by the PropsVisualViewport extension
no setter - offsetLeft → double
-
Available on VisualViewport, provided by the PropsVisualViewport extension
no setter - offsetTop → double
-
Available on VisualViewport, provided by the PropsVisualViewport extension
no setter -
onresize
↔ EventHandlerNonNull<
Event> ? -
Available on VisualViewport, provided by the PropsVisualViewport extension
getter/setter pair -
onscroll
↔ EventHandlerNonNull<
Event> ? -
Available on VisualViewport, provided by the PropsVisualViewport extension
getter/setter pair - pageLeft → double
-
Available on VisualViewport, provided by the PropsVisualViewport extension
no setter - pageTop → double
-
Available on VisualViewport, provided by the PropsVisualViewport extension
no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double
-
Available on VisualViewport, provided by the PropsVisualViewport extension
no setter - width → double
-
Available on VisualViewport, provided by the PropsVisualViewport extension
no setter
Methods
-
addEventListener(
String type, EventListener? callback, [dynamic options]) → void -
Available on EventTarget, provided by the PropsEventTarget extension
-
dispatchEvent(
Event event) → bool -
Available on EventTarget, provided by the PropsEventTarget extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeEventListener(
String type, EventListener? callback, [dynamic options]) → void -
Available on EventTarget, provided by the PropsEventTarget extension
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited