ogmoura

Diário de bordo, data estrelar 3 do 4 do 3 do 2 do 1.

Element Coordinates and Area - JavaScript Tips

| Comments

Hellow everyone.

Today I going to talk about one an interesting method of the Web API Element, this method is called getBoundingClientRect.

This method help us when We want get DOM Element’s coordinates and rectangular area like top, bottom, left, right, width and height.

See my example:

The getBoundingClientRect returns an live object containing bottom, height, left, right, top, width relative of the viewport.

Comments