[JS 基础] touchEvent中的changedTouches,targetTouches和touches的区别

时间:2016-12-01 14:30:03   收藏:0   阅读:491

    对于移动端开发中 touchEvent(触摸事件) 中changedTouches,targetTouches和touches的区别往往不容易弄清,故特意查询了

MDN相关资料

1. 其中,对 changedTouches 的解释是

TouchList whose touch points (Touch objects) varies depending on the event type, as follows:

一个触点对象的列表,取决于事件的类型:

2. 对 targetTouches 的解释是

TouchList listing all the Touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element.

一个触发touchstart事件时触点所在元素上的所有没有离开触摸表面的触点的集合

3.对 touches 的解释是

TouchList listing all the Touch objects for touch points that are currently in contact with the touch surface, regardless of whether or not they‘ve changed or what their target element was at touchstart time.

一个不管是否改变或者目标元素是touchstart事件对应的元素的所有没有离开触摸表面触点的列表。

ps:以上中文翻译均为自己理解。

 

因能力有限,文章中有问题的地方,还请各路高手及时指正。

原文:http://www.cnblogs.com/larui/p/6121452.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!