hover
Motion's hover
function detects hover gestures, firing events when they start and end.
For legacy reasons, browsers emulate hover events from touch devices, which can lead to "stuck" UIs and other unwanted artefacts/behaviours. hover
filters these events out.
hover
is also:
Clean: Automatically manages event listeners
Simple: Accepts Elements or CSS selectors for attaching multiple listeners
Lazy: Attaches only the listeners needed
It can be used to start and stop animations: