Mouse
A utility class for handling mouse-related events.
Constructors
new Mouse()
new Mouse():
Mouse
Returns
Methods
getClientPosition()
static
getClientPosition(event
):Point
Gets the position of the mouse relative to the viewport (visible area of the browser window).
Parameters
• event: MouseEvent
The MouseEvent object that contains the mouse event data.
Returns
A Point object representing the X and Y coordinates relative to the viewport.
Defined in
getOffsetPosition()
static
getOffsetPosition(event
):Point
Gets the position of the mouse relative to the element that triggered the event.
Parameters
• event: MouseEvent
The MouseEvent object that contains the mouse event data.
Returns
A Point object representing the X and Y coordinates relative to the event target.
Defined in
getPagePosition()
static
getPagePosition(event
):Point
Gets the position of the mouse relative to the entire document, including the scroll position.
Parameters
• event: MouseEvent
The MouseEvent object that contains the mouse event data.
Returns
A Point object representing the X and Y coordinates relative to the document.
Defined in
getScreenPosition()
static
getScreenPosition(event
):Point
Gets the position of the mouse relative to the entire screen (including monitor setup).
Parameters
• event: MouseEvent
The MouseEvent object that contains the mouse event data.
Returns
A Point object representing the X and Y coordinates relative to the screen.