ElementRect
Provides the utilities for getting element's metrics.
Static Method Summary
Static Public Methods | ||
public static |
Calculates euclidean distance between two points. |
Constructor Summary
Public Constructor | ||
public |
constructor(element: HTMLElement): ElementRect Initializes a new instance of the |
Member Summary
Public Members | ||
public get |
boundingRect: ClientRect: * Returns the size of the current element and its position relative to the viewport. |
|
public get |
Returns the center coordinates of the current element. |
|
public |
Returns the height of the current element. |
|
public |
Returns the size (the biggest side) of the current element. |
|
public |
Returns the width of the current element. |
Method Summary
Public Methods | ||
public |
Determines if the specified point is contained within this element. |
|
public |
distanceToFarthestCorner(point: {x: Number, y: Number}): Number Calculates the distance between given point and farthest corner of the current element. |
Static Public Methods
Public Constructors
public constructor(element: HTMLElement): ElementRect source
Initializes a new instance of the ElementRect
class with the specified element
.
Params:
Name | Type | Attribute | Description |
element | HTMLElement | The DOM element to get metrics from |
Public Members
public get boundingRect: ClientRect: * source
Returns the size of the current element and its position relative to the viewport.
Return:
ClientRect | The returned value is a |
Public Methods
public contains(ev: Event | Object): Boolean source
Determines if the specified point is contained within this element.
Return:
Boolean | Returns |