helper/touch-simulator.js
function triggerTouch(eventName, mouseEv) {
  var touchEvent = document.createEvent('Event');
  touchEvent.initEvent(eventName, true, true);

  touchEvent.altKey = mouseEv.altKey;
  touchEvent.ctrlKey = mouseEv.ctrlKey;
  touchEvent.metaKey = mouseEv.metaKey;
  touchEvent.shiftKey = mouseEv.shiftKey;

  touchEvent.touches = getActiveTouches(mouseEv);
  touchEvent.targetTouches = getActiveTouches(mouseEv);
  touchEvent.changedTouches = createTouchList(mouseEv);

  eventTarget.dispatchEvent(touchEvent);
}
function triggerTouch(eventName, mouseEv) {
  var touchEvent = document.createEvent('Event');
  touchEvent.initEvent(eventName, true, true);

  touchEvent.altKey = mouseEv.altKey;
  touchEvent.ctrlKey = mouseEv.ctrlKey;
  touchEvent.metaKey = mouseEv.metaKey;
  touchEvent.shiftKey = mouseEv.shiftKey;

  touchEvent.touches = getActiveTouches(mouseEv);
  touchEvent.targetTouches = getActiveTouches(mouseEv);
  touchEvent.changedTouches = createTouchList(mouseEv);

  eventTarget.dispatchEvent(touchEvent);
}
function triggerTouch ( eventName , mouseEv ) { var touchEvent = document . createEvent ( 'Event' ) ; touchEvent . initEvent ( eventName , true , true ) ; touchEvent . altKey = mouseEv . altKey ; touchEvent . ctrlKey = mouseEv . ctrlKey ; touchEvent . metaKey = mouseEv . metaKey ; touchEvent . shiftKey = mouseEv . shiftKey ; touchEvent . touches = getActiveTouches ( mouseEv ) ; touchEvent . targetTouches = getActiveTouches ( mouseEv ) ; touchEvent . changedTouches = createTouchList ( mouseEv ) ; eventTarget . dispatchEvent ( touchEvent ) ; }
trigger a touch event
@param eventName
@param mouseEv
trigger a touch event