Leooonard / Notes

2 stars 0 forks source link

Safari上$(document).on('click', 'selector', callback)不触发的问题 #19

Open Leooonard opened 8 years ago

Leooonard commented 8 years ago

[]具体问题和解决方案])(http://www.shdon.com/blog/2013/06/07/why-your-click-events-don-t-work-on-mobile-safari)

Leooonard commented 8 years ago

顺便看到一个禁止元素被点击的css方案.

设置pointer-event为none.

该属性有许多值可以设置, 但是大部分为svg only, 普通元素上可用的仅为auto和none, auto为默认值, none表示该元素不接受任何鼠标事件. 但是该元素的后代可以, 因此该元素还是可以通过事件冒泡触发响应事件.