我正在使用
window.addEventListener("touchstart", function(ev){
console.log(ev.touches); // good
});
我该如何将这段代码翻译成jQuery?我尝试过:
$(window).bind("touchstart",function(ev){
console.log(ev.touches); // says ev.touches is undefined
}
有什么想法吗?
我正在使用
window.addEventListener("touchstart", function(ev){
console.log(ev.touches); // good
});
我该如何将这段代码翻译成jQuery?我尝试过:
$(window).bind("touchstart",function(ev){
console.log(ev.touches); // says ev.touches is undefined
}
有什么想法吗?
event.originalEvent
访问“本机”事件(请参见此页面上的特殊属性子标题)。$(window).on("touchstart", function(ev) {
var e = ev.originalEvent;
console.log(e.touches);
});
我知道这个问题已经被问了很久,但我认为一个具体的例子可能会有所帮助。