.getOffsetBox()
Available on: InDomReturns a DOMRect with document / page-relative coordinates: left and top are measured from the top-left corner of the document.Returns: {DOMRect} - Native object with left / x, top / y, width, height, right, bottom.Throws:
Error - If the underlying element has been removed
Error - If the underlying element is not connected to the document
Examples:const div = $n('<div></div>');
div.setStyle({
position: 'absolute',
top: '100px',
left: '120px',
width: '80px',
height: '60px'
});
$1('body').append(div);
console.log(JSON.stringify(div.getOffsetBox()));
//DOMRect {"x":120,"y":100,"width":80,"height":60,"top":100,"right":200,"bottom":160,"left":120}Next: addClass »