Search code examples
jqueryiosjquery-pluginscheckboxios6

jquery iButton plugin causing elements to be not clickable in iOS 6


Working fine in iOS 5 and below the jQuery iButton plugin does still work in iOS 6 but causing multiple other Elements on the page to no longer clickable. (happens in chrome as well as in safari on the iPad)

When touch-holding on those Elements they don't get focussed, but their parent Element.

This seems not to be related with the jQuery version used.

Does anyone know of a possible fix for this?

Or has anyone a suggestion for an alternative library for iOS-style-on/off-buttons. (should also support touch/swipe etc)

as we're working on some closed backend-app, posting code examples is unfortunately not possible.


Solution

  • found the solution.

    replace this:

    $(document).bind("mouseup.iButton_" + id + " touchend.iButton_" + id, function(e) {
    

    with this:

    $(document).delegate(".ibutton-container","mouseup.iButton_" + id + " touchend.iButton_" + id, function(e) {
    

    in the ibutton plugin.

    (in jquery versions greater than 1.7 you should use on() instead of delegate() )