DOMRectReadOnly - Web APIs 编辑
The DOMRectReadOnly
interface specifies the standard properties used by DOMRect
to define a rectangle whose properties are immutable.
Constructor
DOMRectReadOnly()
- Defined to create a new
DOMRectReadOnly
object. Note that this constructor cannot be called by 3rd party JavaScript; doing so returns an"Illegal constructor"
TypeError
.
Properties
DOMRectReadOnly.x
Read only- The x coordinate of the
DOMRect
's origin. DOMRectReadOnly.y
Read only- The y coordinate of the
DOMRect
's origin. DOMRectReadOnly.width
Read only- The width of the
DOMRect
. DOMRectReadOnly.height
Read only- The height of the
DOMRect
. DOMRectReadOnly.top
Read only- Returns the top coordinate value of the
DOMRect
(usually the same asy
.) DOMRectReadOnly.right
Read only- Returns the right coordinate value of the
DOMRect
(usually the same asx + width
). DOMRectReadOnly.bottom
Read only- Returns the bottom coordinate value of the
DOMRect
(usually the same asy + height
). DOMRectReadOnly.left
Read only- Returns the left coordinate value of the
DOMRect
(usually the same asx
).
Static methods
DOMRectReadOnly.fromRect()
- Creates a new
DOMRect
object with a given location and dimensions.
Specifications
Specification | Status | Comment |
---|---|---|
Geometry Interfaces Module Level 1 The definition of 'DOMRectReadOnly' in that specification. | Candidate Recommendation | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论