我使用joystick.js
。我的目标是每当我触摸(ontouchstart
)时都会调用onclick
。
我在下面尝试了此操作,但没有成功。我的操纵杆使我无法触摸按钮。我什至用onclick
替换了ontouchstart
,但我使用jQuery。我不能改变一切。对于任何想法,我将不胜感激。
document.getElementById("overlyas").ontouchstart = function(e){
var ontouchstart = onclick;
}
答案 0 :(得分:0)
要解决ios无法识别onclick事件的问题,可以在主css文件中将光标设置为指针:
* {
cursor: pointer;
}
然后它将注册onclick事件。我认为它默认情况下只能识别onmousedown。
不确定这是否真的回答了您的问题,但是在编写混合应用程序时为我省去了很多麻烦。...