Skip to content

Instantly share code, notes, and snippets.

@pennyfx
Created November 8, 2013 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pennyfx/7378881 to your computer and use it in GitHub Desktop.
Save pennyfx/7378881 to your computer and use it in GitHub Desktop.
touchevent
var te = document.createEvent('TouchEvent');
var touch = document.createTouch(window, document, 0,0,0,0,0);
var touchList = document.createTouchList(touch);
te.initTouchEvent('touchstart', true, true, window, {}, false, false, false, false,touchList,touchList,touchList);
te.view = window;
te.altKey = false;
te.ctrlKey = false;
te.shiftKey = false;
te.metaKey = false;
document.dispatchEvent(te);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment