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

MDN相关资料

1. 其中,对 changedTouches 的解释是

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

  • For the touchstart event, it is a list of the touch points that became active with the current event.
  • For the touchmove event, it is a list of the touch points that have changed since the last event.
  • For the touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface).

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

  • 对于 touchstart 事件,它是一个触发当前事件的触点的列表;
  • 对于 touchmove 事件,它是一个从最后一次事件对比,改变的触点的列表;
  • 对于 touchend 事件,它是已经从触摸表面移除的触点的列表(即,这些触点对应的手指不再与触摸表面接触)

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:以上中文翻译均为自己理解。

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

[JS 基础] touchEvent中的changedTouches,targetTouches和touches的区别的更多相关文章

  1. JAVA基础----java中E,T,?的区别?

    http://825635381.iteye.com/blog/2017650 遇到<A>,<B>,<K,V>等,是用到了java中的泛型. 一般使用<T&g ...

  2. JAVA基础----java中E,T,?的区别

    遇到<A>,<B>,<K,V>等,是用到了java中的泛型. 一般使用<T>来声明类型持有者名称,自定义泛型类时,类持有者名称可以使用T(Type) 如 ...

  3. js删除数组中的元素delete和splice的区别

    例如有一个数组是 :var textArr = ['a','b','c','d']; 这时我想删除这个数组中的b元素: 方法一:delete 删除数组 delete textArr[1]  结果为:  ...

  4. [ 原创 ] Java基础1--Java中super和this的用法和区别

    许多同学在学习Java时分不清楚this和super的用法和区别,今天偶然发现一片加精的博文,看完内容准备自己也写下来积累一下 1.如果想在子类的构造方法中调用父类的构造方法,必须在子类的构造方法中使 ...

  5. Java基础——java中String、StringBuffer、StringBuilder的区别

    (转自:http://www.cnblogs.com/xudong-bupt/p/3961159.html) java中String.StringBuffer.StringBuilder是编程中经常使 ...

  6. 【JS】JavaScript中innerHTML与innerText,createTextNode的区别

    innerHTML和innerText 它们都会把元素内内容替换掉,区别在于: innerHTML 会把替换内容里的 HTML 标记解释执行. innerText 会把替换内容里的 HTML 标记原样 ...

  7. [Python基础]Python中remove,del和pop的区别

    以a=[1,2,3] 为例,似乎使用del, remove, pop一个元素2 之后 a都是为 [1,3], 如下:http://Novell.Me >>> a=[1,2,3] &g ...

  8. 【js基础修炼之路】— null和undefined的区别

    在近期的复习期间遇到null和nudefined,于是通过查找资料,想写一篇文章来说明他们的区别.. javaScript高级程序设计: 在使用var声明变量但未对其加以初始化时,这个变量的值就是un ...

  9. js基础篇——call/apply、arguments、undefined/null

    a.call和apply方法详解 call方法: 语法:call([thisObj[,arg1[, arg2[,   [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象 ...

随机推荐

  1. android gallery 自定义边框+幻灯片

    最近在项目中用到图片轮播,试了Gallery,ViewFlipper,ViewPager,感觉Gallery最符合需求,但是Gallery的系统边框很难看,项目中要求用自己的背景图片. 下面来看一下使 ...

  2. JQuery Ajax 在asp.net中使用小结

    自从有了JQuery,Ajax的使用变的越来越方便了,但是使用中还是会或多或少的出现一些让人短时间内痛苦的问题.本文暂时总结一些在使用JQuery Ajax中应该注意的问题,如有不恰当或者不完善的地方 ...

  3. UVA 10765 Doves and bombs(双连通分量)

    题意:在一个无向连通图上,求任意删除一个点,余下连通块的个数. 对于一个非割顶的点,删除之后,原图仍连通,即余下连通块个数为1:对于割顶,余下连通块个数>=2. 由于是用dfs查找双连通分量,树 ...

  4. AngularJS:实现动态添加输入控件功能(转)

    http://www.cnblogs.com/ilovewindy/p/3849428.html <!DOCTYPE html> <html> <head> < ...

  5. [Everyday Mathematics]20150106

    (1). 设 $f\in C[0,T]$, $g$ 是 $T$-周期函数, 试证: $$\bex \vlm{n}\int_0^T f(x)g(nx)\rd x=\frac{1}{T}\int_0^T ...

  6. HDU 4336-Card Collector(状压,概率dp)

    题意: 有n种卡片,每包面里面,可能有一张卡片或没有,已知每种卡片在面里出现的概率,求获得n种卡片,需要吃面的包数的期望 分析: n很小,用状压,以前做状压时做过这道题,但概率怎么推的不清楚,现在看来 ...

  7. 【LeetCode 201】Bitwise AND of Numbers Range

    Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers ...

  8. 【整理】Visual Studio快捷键

    说明 很多开发人员使用Visual Studio的时候,由于对VS快捷键不熟悉,会影响到实际的开发效率.其实,有很多我们不知道(或已知)的快捷键,在我们熟练运用以后,能够提高我们整体的工作效率.以下是 ...

  9. CATALOGUE 目录

    1 语言基础 1.1 c/c++ [转]C/C++ 存储类型 作用域 连接类型 [转]C/C++内存划分 [转]C/C++除法实现方式及负数取模详解 [转]为什么C++编译器不能支持对模板的分离式编译 ...

  10. Trail: JDBC(TM) Database Access(2)

    package com.oracle.tutorial.jdbc; import java.sql.CallableStatement; import java.sql.Connection; imp ...