External module "mouse-position"
Type aliases
Vec2
Vec2: object
Functions
elementOffset
- elementOffset(elem: HTMLElement | ClientRect | DOMRect, ignoreWindowOffset?: boolean, targetBox?: Vec2): Vec2
-
Parameters
-
elem: HTMLElement | ClientRect | DOMRect
-
Default value ignoreWindowOffset: boolean = true
-
Default value targetBox: Vec2 = {x:0,y:0}
Const getWindow
- getWindow(elem: any): Window
-
Parameters
Returns Window
Const isHTMLElement
- isHTMLElement(elem: any): boolean
-
Parameters
Returns boolean
Const isTouchEvent
- isTouchEvent(c: any): boolean
-
Parameters
Returns boolean
Const isWindow
- isWindow(elem: any): boolean
-
Parameters
Returns boolean
mousePosition
- mousePosition(clientX: number, clientY: number, element?: HTMLElement | ClientRect | DOMRect, offset?: Vec2, target?: Vec2): Vec2
-
Parameters
-
clientX: number
-
clientY: number
-
Optional element: HTMLElement | ClientRect | DOMRect
-
Optional offset: Vec2
-
Optional target: Vec2
mousePositionFromEvent
- mousePositionFromEvent(event: MouseEvent | TouchEvent, element?: HTMLElement | ClientRect | DOMRect, offset?: Vec2, target?: Vec2): Vec2
-
Parameters
-
event: MouseEvent | TouchEvent
-
Optional element: HTMLElement | ClientRect | DOMRect
-
Optional offset: Vec2
-
Optional target: Vec2
Object literals
Const __tmpVec2
__tmpVec2: object
x
x: number = 0
y
y: number = 0
Calculate the offset of element