offset

returns the position of an HTML element on the page and its size

object offset(HTMLElement node);
nodeHTMLElementan HTML element
objectthe position object of an HTML element

Example

var elem = document.getElementById("myDiv")
webix.html.offset(elem); // returns {y: 20, x: 28, width: 600, height: 600}

Details

The returned object contains the following properties:

  • y - the top absolute position
  • x - the left absolute position
  • width - the width of the element
  • height - the height of the element
See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.