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 width property
- Web API | DOMRect left property
- Web API | DOMRect bottom property
- Web API | DOMRect height property
- Web DOMRect API | DOMRect() Constructor
- CSS | transition-property Property
- CSS | nav-right property
- CSS | nav-down property
- CSS | nav-up property
- CSS | all Property
- CSS | right Property
- CSS | top Property
- HTML | DOM id 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 firstname.lastname@example.org. 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.