Jquery click not working with ipad

后端 未结 11 889
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 12:38

we have a web application which is using Jquery blockUI to open a pop up and do some action. All of this works fine on Safari, and IE 8. problem is with Ipad. none of the ac

11条回答
  •  独厮守ぢ
    2020-12-02 12:48

    UPDATE: I switched .bind to .on because it's now the preferred way says jQuery.

    As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document. jquery.com

    EXAMPLE:

    $('.button').on("click touchstart", function() {
    
    });
    

    Below is the ultimate version of the click and touchstart event because it still fires even with new DOM objects that are added after the DOM has been loaded. Incorporating this ultimate click event solution for any scenario.

    $(document).on("click touchstart", ".button", function () {
    
    });
    

提交回复
热议问题