IOS 微信内 click事件无效

$(document).on('click','span',function(e) {

console.log(e);

});

原因:针对这种使用代理的‘click’事件监听,在ios的微信浏览器中要求元素必须是button,其他的元素都无效。

第一种方法:需要绑定事件的元素添加一个css cursor: pointer 。

第二种方法:把document换成selector的父元素,前提是父元素不是由JS生成的。

你可能感兴趣的:(IOS 微信内 click事件无效)