Javascript iPhone模拟器上未启动ontouch函数
在iPhone模拟器上,Javascript iPhone模拟器上未启动ontouch函数,javascript,ios,dom-events,ios-simulator,iphone-4,Javascript,Ios,Dom Events,Ios Simulator,Iphone 4,在iPhone模拟器上,ontouch的事件回调似乎不起作用 以下内容在我的模拟器上似乎不起作用: document.ontouch = function() { alert('it works!'); } 尽管这确实返回了真值: if ('ontouch' in document) { alert('touch supported'); } 还有其他人有此问题吗?有3个与触摸相关的事件: ontouchstart 安顿图奇酒店 ontouchend 用这些试试,应该没问题
ontouch
的事件回调似乎不起作用
以下内容在我的模拟器上似乎不起作用:
document.ontouch = function() {
alert('it works!');
}
尽管这确实返回了真值:
if ('ontouch' in document) {
alert('touch supported');
}
还有其他人有此问题吗?有3个与触摸相关的事件: