๐ง 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.