Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. var simulateTouch = require('simulate-touch')
  2.  
  3. simulateTouch(document.body)
  4.  
  5. document.body.addEventListener('touchstart', function () {
  6. console.log('touch start')
  7. })
  8.  
  9. var mousedownEvent = document.createEvent("MouseEvent");
  10. mousedownEvent.initMouseEvent(event, true, true, window, 0,
  11. 0, 0, 0, 0,
  12. false, false, false, false,
  13. 0, null);
  14.  
  15.  
  16. document.body.dispatchEvent(mousedownEvent)
  17. // touch started
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement