Search...
onMouseIn( )
Adds an event handler that runs when the mouse pointer is moved onto the element.
Deprecation note: The $w parameter of event handlers is being deprecated. To get
a scoped selector for working with elements in repeater items, use the $w.at() function
and pass it the context property of the event parameter: $item = $w.at(event.context)
. To learn more, see
here.
You can also define an event handler using the Properties and Events panel.
Syntax
function onMouseIn(handler: MouseEventHandler): Elementhandler: function MouseEventHandler(event: MouseEvent, $w: $w): void
onMouseIn Parameters
NAME
TYPE
DESCRIPTION
handler
The name of the function or the function expression to run when the mouse pointer is moved onto the element.
MouseEventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
void
Mixed in from:$w.Element
Was this helpful?
Get the mouse event info when the mouse enters an element
Code Example
1$w("#myElement").onMouseIn( (event) => {2 let clientX = event.clientX; // 3623 let clientY = event.clientY; // 2444 let offsetX = event.offsetX; // 105 let offsetY = event.offsetY; // 126 let pageX = event.pageX; // 3627 let pageY = event.pageY; // 3768 let screenX = event.screenX; // 38979 let screenY = event.screenY; // 36210} );