Jquery click not working with ipad

后端 未结 11 918
隐瞒了意图╮
隐瞒了意图╮ 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:51

    I know this was asked a long time ago but I found an answer while searching for this exact question.

    There are two solutions.

    You can either set an empty onlick attribute on the html element:

    Or you can add it in css by setting the pointer cursor:

    .clickElement { cursor:pointer }
    

    The problem is that on ipad, the first click on a non-anchor element registers as a hover. This is not really a bug, because it helps with sites that have hover-menus that haven't been tablet/mobile optimised. Setting the cursor or adding an empty onclick attribute tells the browser that the element is indeed a clickable area.

    (via http://www.mitch-solutions.com/blog/17-ipad-jquery-live-click-events-not-working)

提交回复
热议问题