0

For accessibility purposes we have a few buttons like:

$(".class").on('click touch touchstart touchend', function () { });

So this covers both desktop and mobile. The problem is you have to triple tap in IOS (with voiceover) to fire the event.

Is there a way that you can fire the event on a double tap either by tapping the object directly or by swiping to it?

Because you can swipe between objects, you should be able to swipe to the object and then double tap - but nothing I try does this?

Any suggestions?

Paul VI
  • 515
  • 1
  • 8
  • 25

1 Answers1

1

You shouldn't need to check the specific event. For something like a button or anchor tag, the click event is fired regardless of the mechanism of activating the object.

   <button onclick='alert("foo!")'>foo</button>
   <br>
   <a href='#' onclick='alert("bar!")'>bar</a>

When you click with the mouse, tab to the object and hit ENTER, tap the object on a mobile device, or double tap (*) with voiceover, the onclick() is fired.

(*) I'm assuming you meant double tap with voiceover and not triple tap as your originally posted. Triple tap is only valid with two or three fingers to display the item chooser or turn speech off, respectively.)

slugolicious
  • 15,824
  • 2
  • 29
  • 43