次の方法で共有


DiagnosticsViewport object

Provides an object for methods and properties associated with the viewport.

Note  These APIs can only be used with F12 developer tools and the Diagnostics Script Engine, and can't be called from JavaScript.

 

 

Syntax

 var oViewport = DiagnosticsEmulation.viewport;

DOM Information

Inheritance Hierarchy

The DiagnosticsViewport does not inherit from any class or interface.

Members

The DiagnosticsViewport object has these types of members:

  • Methods
  • Properties

Methods

The DiagnosticsViewport object has these methods.

Method Description
restoreOriginalSettings

Resets the viewport to cached dimensions and orientation.

setDimensions

Gets or sets the viewport's dimensions in pixels.

 

Properties

The DiagnosticsViewport object has these properties.

Property Access type Description

heightInPx

Read/write

Sets or gets height of viewport in pixels.

orientation

Read/write

Gets or sets whether viewport is portrait or landscape mode.

widthInPx

Read/write

Sets or gets width of viewport in pixels.