GetHtmlRect Method (DomElement)

Class

DomElement.

Action

Retrieves the rectangle of a DomElement relative to the BrowserWindow in HTML pixels. In contrast to the screen coordinates that are provided by the GetRect function, the coordinates provided by GetHtmlRect are not affected by the zoom level on mobile browsers. The click function also uses HTML pixel coordinates for all DomElements. We recommend to use GetHtmlRect for all position calculations within the browser. This will ensure that your scripts are cross-browser capable and your position calculations are not effected by changing zoom levels on mobile browsers.

Syntax

C#
htmlRect = element.GetHtmlRect()
VB
htmlRect = element.GetHtmlRect()
Variable Description
htmlRect Rectangle.