jsWAVES.js
//map touch events to mouse events for touch compatibility:
map touch events to mouse events for touch compatibility.
map touch events to mouse events for touch compatibility .
function touchHandler(event)
{
    var touches = event.changedTouches,
	first = touches[0],
	type = "";
	switch(event.type)
	{
	  case "touchstart": type="mousedown"; break;
	  case "touchmove":  type="mousemove"; break;        
	  case "touchend":   type="mouseup"; break;
	  default: return;
	}
    var simulatedEvent = document.createEvent("MouseEvent");
    simulatedEvent.initMouseEvent(type, true, true, window, 1, 
                                  first.screenX, first.screenY, 
                                  first.clientX, first.clientY, false, 
                                  false, false, false, 0, null);
    first.target.dispatchEvent(simulatedEvent);
    event.preventDefault();
}
function touchHandler ( event ) { var touches = event . changedTouches , first = touches [ 0 ] , type = "" ; switch ( event . type ) { case "touchstart" : type = "mousedown" ; break ; case "touchmove" : type = "mousemove" ; break ; case "touchend" : type = "mouseup" ; break ; default : return ; } var simulatedEvent = document . createEvent ( "MouseEvent" ) ; simulatedEvent . initMouseEvent ( type , true , true , window , 1 , first . screenX , first . screenY , first . clientX , first . clientY , false , false , false , false , 0 , null ) ; first . target . dispatchEvent ( simulatedEvent ) ; event . preventDefault ( ) ; }
map touch events to mouse events for touch compatibility:
map touch events to mouse events for touch compatibility :
//initMouseEvent(type, canBubble, cancelable, view, clickCount,  //               screenX, screenY, clientX, clientY, ctrlKey,  //               altKey, shiftKey, metaKey, button, relatedTarget); /*left*/