Answer the question
In order to leave comments, you need to log in
Onclick event in web applications in desktop and iOS browsers?
In the iOS Safari browser, the onClick event fires after ~400ms (you can check it here ). To avoid this, you can use the touchstart event.
Is it possible to somehow determine for all elements on the page if it has an onClick handler? then replace onClick with touchstart. Better if it's in jQuery.
Now I explicitly indicate why I need to replace the handlers
$('.sidebar_item').live('touchstart', function(e) {<br>
$(this).click();<br>
e.preventDefault();<br>
});<br>
$('*').each(function() {<br>
var me = $(this);<br>
if(me.click != null) {<br>
// но me.click есть для всех элементов<br>
}<br>
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question