Mobile javascript events compared to their desktop counterparts

mobile-js-events-2

If you are working on a mobile HTML5 website / app you probably want to know what are the javascript events you can use based on the user interaction. Well, here is a list (cheatsheet); bellow is a table comparing the mobile javascript events with their desktop counterparts. The “composed” column shows similar mobile events that may also be triggered.

ActionDesktopMobileComposed
Mouse downonmousedowntouchstart
Mouse moveonmousemovetouchmove
Mouse uponmouseuptouchend
Clickonclicktouchstart + touchend
Double clickondblclicktouchstart + touchend + touchstart + touchend
Dragonmousedown + onmousemove + onmouseuptouchstart + touchmove + touchend
Mouse overonmouseovertouchentertouchstart + touchmove
Mouse outonmouseouttouchleavetouchenter + touchmove
Tab two fingers
start pinch / zoom
gesturestarttouchstart + touchmove
Pinch / zoomgesturechangegesturestart + touchmove
Stop pinch / zoomgestureendtouchmove +
touchend
Pinch / zoom interruptiontouchcancel
Rotate deviceorientationchange

If you have any questions  please leave a comment bellow.


Leave a Reply

Your email address will not be published. Required fields are marked *