0

I'm developing a webapp for iOS using jQueryMobile. I'm trying to avoid the 300ms delay on click, as I'm not using the double click event.

I've tried FastClick.js, but it's not fully compatible with jQM, as the event is sometimes fired twice, especially with checkboxes and radio buttons.

I use the needsclick class for those cases, but in some complex cases, it seems to be ignored, so I still have the event being fired twice. Because of this, I removed FastClick and am using the vclick event instead. It works fine for the click event, but it doesn't effect change events, and there is no vchange event.

I can't use the vclick event for checkboxes, as I need to test if it's checked.

How can I avoid the 300ms delay on click?

JSFiddle

HTML:

<input type="checkbox" id="check" value="1">
<label for="check">check</label>

JavaScript:

$("input").change(function() {
    if (this.checked) {
        $(this).next().css("color","green");
    } else {
        $(this).next().css("color","black");
    }
});
Nic
  • 6,211
  • 10
  • 46
  • 69
Matthieu
  • 563
  • 1
  • 7
  • 25

0 Answers0