jQuery 第17章 在ios中Safari浏览器使用jQuery的bind click 事件时会失效 jQuery 第17章 在ios中Safari浏览器使用jQuery的bind click 事件时会失效

2022-08-17

解决办法是使用 touchstart 替换 click

var user_agent = navigator.userAgent.toLowerCase();
var ios_devices = user_agent.match(/(iphone|ipod|ipad)/)  ? "touchstart" : "click";
$(document).on(ios_devices,"button",function() {
    
});

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开微信扫一扫,即可进行扫码打赏哦

阅读 600