touch event 存疑

编程入门 行业动态 更新时间:2024-10-28 19:20:07

<a href=https://www.elefans.com/category/jswz/34/1759840.html style=touch event 存疑"/>

touch event 存疑

1.原声js与借用jquery输出来的事件列表却不一样

  

function touchPlay(e)
{e.preventDefault();console.log(e);
}
var screen = document.getElementById("screen");
screen.addEventListener("touchstart", touchPlay, null);
screen.addEventListener("touchmove", touchPlay, null);

输出: 

$(function(){$("#screen").on("touchstart touchmove touchend", function(e){console.log(e);});
});

输出:  


而如果这样输出,就和使用js输入的是一样了。不清楚jq关于这里的运行原理,存疑。

console.log(e.originalEvent);

  

转载于:.html

更多推荐

touch event 存疑

本文发布于:2024-02-25 02:45:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1697522.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:touch   event

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!