I’m using JS+jQuery to create an interactive menu supposed to work both with pc and mobile devices. The menu is created on-the-fly, so I need to use .on().
I’m testing the mobile side with my iPad, my code is something like this:
jQuery(document).on('click touchstart','.button', function(){ /* Do... */ });
The click event works fine on my PC, but the touchstart doesn’t do anything. Even leaving click or touchstart only it doesn’t work on my iPad.
I’ve definitely solved by putting
touchstartbeforeclickin the.on()method.