I have a button that when pressed brings you to the top of the page and highlights a search input. It works fine except the iPad where the user has to click twice to force it to work.
It is not a matter or recognizing a touch event, but making sure that the touch event fires on the first try.
How can I avoid the "double touch" on an iPad?
$('.my-button').click(function() {
$("html, body").animate({ scrollTop: 0 }, 500);
$('.search').addClass('highlighted');
});