跨度点击不适用于iPhone/iPad浏览器
$(document).on('click', '.span-btn', function(event) {
event.stopImmediatePropagation();
if(event.target.id == null || event.target.id.length < 1) return;
console.log(event.target.id)
});
点击功能在iOS设备浏览器上不起作用。尝试了多种方法 - 接触式,光标:指针和与跨度的绑定。目前,我添加了“ Span-BTN”类的CSS中的光标:指针,以及上述处理单击的代码。
$(document).on('click', '.span-btn', function(event) {
event.stopImmediatePropagation();
if(event.target.id == null || event.target.id.length < 1) return;
console.log(event.target.id)
});
Click function is not working on iOS device browsers. Tried multiple approaches - touchstart, cursor: pointer and binding to the span. Currently, I have added cursor: pointer in the css for the 'span-btn' class and the above code for handling the click.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用iPad和iPhone的
touchstart
事件。进而
Try using
touchstart
event for iPads and iPhones.and then