美文网首页
二十、对于ios9中的onclick点击无效的解决办法

二十、对于ios9中的onclick点击无效的解决办法

作者: yuzhan550 | 来源:发表于2018-07-10 01:05 被阅读63次

在标签中,使用ontouchend来替代onclick,同时在js中添加:

$(document).on('touchend','',function(){
});
//$(document).on('touchend');    // This couldn't work

即可!

不好用的办法如下:

$(document).on("click touchstart",function(){ // 这个会响应twice,且有延迟,about 1''34'''
    var audio = document.getElementById('missing10');
    audio.load();
});

参考地址:https://www.cnblogs.com/xulei1992/p/6559386.html

相关文章

网友评论

      本文标题:二十、对于ios9中的onclick点击无效的解决办法

      本文链接:https://www.haomeiwen.com/subject/tomxpftx.html