🚧 under construction
Last updated 1 year ago
browser ⟩ event ⟩ type ⟩ mouse
contextmenu – mouse right-clicks on an element.
contextmenu
mouseover/mouseout – mouse cursor comes over / leaves an element.
mouseover
mouseout
mousedown/mouseup – mouse is pressed / released over an element.
mousedown
mouseup
mousemove – mouse is moved.
mousemove
click – fires after "mouseup".
click
dblclick – fires after second "click".
dblclick
👉 compare:Element+boxes
If you tap the screen, you’ll get
touch events:"touchstart", "touchend", then
mouse events:"mousedown", "mouseup", "click"❗
box models
touch event
drag event
👉 Element+boxes
mouse event coords - compare .client/.page/.screenXY
Eloquent JS ⟩ Ch. 15: Event Handling ⟩ Mouse Clicks
Event ⟩ UIEvent ⟩ MouseEvent ⟩
(.screenX, .screenY) - relative to whole screen.
(.pageX, .pageY) - relative to document.
(.clientX, .clientY) - relative to viewport.