DOMRect: DOMRect() コンストラクター

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

DOMRect() コンストラクターは、新しい DOMRect オブジェクトを作成します。

構文

js
new DOMRect(x, y, width, height)

引数

x

この DOMRect の原点の x 座標です。

y

この DOMRect の原点の y 座標です。

width

この DOMRect の幅です。

height

この DOMRect の高さです。

返値

新しい DOMRect オブジェクトです。

仕様書

Specification
Geometry Interfaces Module Level 1
# dom-domrect-domrect

ブラウザーの互換性

関連情報