1

This is how I simulate a click in a web browser:

$(document).ready(function() {
  $("button").click();
});

But how can I simulate a vclick instead? The reason is I want to automate a tap on mobile devices. Any ideas?

Ralph David Abernathy
  • 4,879
  • 9
  • 47
  • 72

1 Answers1

1

I suppose you can use this:

$('button').trigger('vclick');

Use vclick with caution! See https://api.jquerymobile.com/vclick/

Update: possible alternative

$('button').trigger('tap');

See also: Eliminate 300ms delay on click events in mobile Safari

Update: did you try/know Hammer.js? Take a look at http://hammerjs.github.io/recognizer-tap/ and http://hammerjs.github.io/tips/

Community
  • 1
  • 1
schellingerht
  • 5,611
  • 2
  • 27
  • 52