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
  • 5,230
  • 11
  • 51
  • 78

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,726
  • 2
  • 28
  • 56