In Web API there is a DOMRect Interface which has a property fromRect() which creates a DOMRectReadOnly object which has location and dimensions given.
var domRect = DOMRectReadOnly.fromRect(DOMRect object)
It returns an instance of DOMRect
Example: Using fromRect.
Before click the button:
After clicked the button:
- Google Chrome
- Safari 10.1
- Web API | DOMRect right property
- Web API | DOMRect top property
- Web API | DOMRect height property
- Web API | DOMRect bottom property
- Web API | DOMRect left property
- Web API | DOMRect width property
- Web DOMRect API | DOMRect() Constructor
- CSS | transition-property Property
- CSS | all Property
- CSS | top Property
- CSS | right Property
- CSS | nav-right property
- CSS | nav-down property
- CSS | nav-up property
- HTML | DOM dir Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.