jQuery .on() and .delegate() doesn't work on iPad

后端 未结 7 776
北荒
北荒 2020-12-05 04:38

If you try this snippet on desktop, everything works.
Whenever you try it on iPad, it won\'t do anything.

7条回答
  •  清歌不尽
    2020-12-05 04:59

    It's a Safari mobile bug/feature : click events won't bubble all the way up to body.

    Adding onclick="" is a known workaround, but IMHO it's easier to attach your listener on a first child of .

    See: http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html

提交回复
热议问题