DOMRectReadOnly
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}
The **DOMRectReadOnly** interface specifies the standard properties (also used by {{domxref("DOMRect")}}) to define a rectangle whose properties are immutable.
Constructor
- {{domxref("DOMRectReadOnly.DOMRectReadOnly","DOMRectReadOnly()")}}
- : Defined to create a new
DOMRectReadOnlyobject.
Instance properties
- {{domxref("DOMRectReadOnly.x")}} {{ReadOnlyInline}}
- : Returns the x coordinate of the
DOMRectReadOnly's origin. - {{domxref("DOMRectReadOnly.y")}} {{ReadOnlyInline}}
- : Returns the y coordinate of the
DOMRectReadOnly's origin. - {{domxref("DOMRectReadOnly.width")}} {{ReadOnlyInline}}
- : Returns the width of the
DOMRectReadOnly. - {{domxref("DOMRectReadOnly.height")}} {{ReadOnlyInline}}
- : Returns the height of the
DOMRectReadOnly. - {{domxref("DOMRectReadOnly.top")}} {{ReadOnlyInline}}
- : Returns the top coordinate value of the
DOMRectReadOnly(usually the same asy). - {{domxref("DOMRectReadOnly.right")}} {{ReadOnlyInline}}
- : Returns the right coordinate value of the
DOMRectReadOnly(usually the same asx + width). - {{domxref("DOMRectReadOnly.bottom")}} {{ReadOnlyInline}}
- : Returns the bottom coordinate value of the
DOMRectReadOnly(usually the same asy + height). - {{domxref("DOMRectReadOnly.left")}} {{ReadOnlyInline}}
- : Returns the left coordinate value of the
DOMRectReadOnly(usually the same asx).
Static methods
- {{domxref("DOMRectReadOnly/fromRect_static", "DOMRectReadOnly.fromRect()")}}
- : Creates a new
DOMRectReadOnlyobject with a given location and dimensions.
Instance methods
- {{domxref("DOMRectReadOnly.toJSON()")}}
- : Returns a JSON-serializable plain object representing the
DOMRectReadOnlyobject. Automatically called by {{jsxref("JSON.stringify()")}}.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{domxref("DOMPoint")}}