Skip to content

Instantly share code, notes, and snippets.

View ivan1986's full-sized avatar

Ivan Borzenkov ivan1986

  • Russia, Bryansk
View GitHub Profile
@ivan1986
ivan1986 / touchmouse.js
Created August 3, 2012 10:50 — forked from roboshoes/touchmouse.js
This snippet maps mouse events and touch events onto one single event. This makes it easier in the code since you have to listen to only one event regardles whether it's desktop or mobile.
(function() {
/* == GLOBAL DECLERATIONS == */
TouchMouseEvent = {
DOWN: "touchmousedown",
UP: "touchmouseup",
MOVE: "touchmousemove"
}
/* == EVENT LISTENERS == */