Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

DOMRect

BaselineWidely available

Note: This feature is available inWeb Workers.

ADOMRect describes the size and position of a rectangle.

The type of box represented by theDOMRect is specified by the method or property that returned it. For example,Range.getBoundingClientRect() specifies the rectangle that bounds the content of the range using such objects.

It inherits from its parent,DOMRectReadOnly.

DOMRectReadOnly DOMRect

Constructor

DOMRect()

Creates a newDOMRect object.

Instance properties

DOMRect inherits properties from its parent,DOMRectReadOnly. The difference is that they are not read-only anymore.

DOMRect.x

The x coordinate of theDOMRect's origin (typically the top-left corner of the rectangle).

DOMRect.y

The y coordinate of theDOMRect's origin (typically the top-left corner of the rectangle).

DOMRect.width

The width of theDOMRect.

DOMRect.height

The height of theDOMRect.

DOMRectReadOnly.top

Returns the top coordinate value of theDOMRect (has the same value asy, ory + height ifheight is negative).

DOMRectReadOnly.right

Returns the right coordinate value of theDOMRect (has the same value asx + width, orx ifwidth is negative).

DOMRectReadOnly.bottom

Returns the bottom coordinate value of theDOMRect (has the same value asy + height, ory ifheight is negative).

DOMRectReadOnly.left

Returns the left coordinate value of theDOMRect (has the same value asx, orx + width ifwidth is negative).

Static methods

DOMRect may also inherit static methods from its parent,DOMRectReadOnly.

DOMRect.fromRect()

Creates a newDOMRect object with a given location and dimensions.

Instance methods

DOMRect may inherit methods from its parent,DOMRectReadOnly.

Specifications

Specification
Geometry Interfaces Module Level 1
# DOMRect

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp