Archive for October, 2012

01
Oct

JQuery. Processing clicks in iPhone

Posted by eugene as Javascript

In sake of interest I’ve decided to check one of my Web projects and how it works on iPhone. There is much javascript in this project. I’ve observed the buttons on which the click event is assigned with the help of jQuery work very odd. With the first click the selection is carried out – css :hover runs, and the click itself works out only if to click the same button once again.

We’ve found out that Safari browser do not process the click event for some elements but it’s possible to assign the tap, touchstart event onto these elements. As a result, I decided to assign both events to the button, what has consequently resolved the issue:

$(‘#fn-cue’).bind(‘click touchstart’, router.actions.cue);