[JS 基础] touchEvent中的changedTouches,targetTouches和touches的区别
对于移动端开发中 touchEvent(触摸事件) 中changedTouches,targetTouches和touches的区别往往不容易弄清,故特意查询了
1. 其中,对 changedTouches 的解释是
A 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 的解释是
A 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 的解释是
A 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的区别的更多相关文章
- JAVA基础----java中E,T,?的区别?
http://825635381.iteye.com/blog/2017650 遇到<A>,<B>,<K,V>等,是用到了java中的泛型. 一般使用<T&g ...
- JAVA基础----java中E,T,?的区别
遇到<A>,<B>,<K,V>等,是用到了java中的泛型. 一般使用<T>来声明类型持有者名称,自定义泛型类时,类持有者名称可以使用T(Type) 如 ...
- js删除数组中的元素delete和splice的区别
例如有一个数组是 :var textArr = ['a','b','c','d']; 这时我想删除这个数组中的b元素: 方法一:delete 删除数组 delete textArr[1] 结果为: ...
- [ 原创 ] Java基础1--Java中super和this的用法和区别
许多同学在学习Java时分不清楚this和super的用法和区别,今天偶然发现一片加精的博文,看完内容准备自己也写下来积累一下 1.如果想在子类的构造方法中调用父类的构造方法,必须在子类的构造方法中使 ...
- Java基础——java中String、StringBuffer、StringBuilder的区别
(转自:http://www.cnblogs.com/xudong-bupt/p/3961159.html) java中String.StringBuffer.StringBuilder是编程中经常使 ...
- 【JS】JavaScript中innerHTML与innerText,createTextNode的区别
innerHTML和innerText 它们都会把元素内内容替换掉,区别在于: innerHTML 会把替换内容里的 HTML 标记解释执行. innerText 会把替换内容里的 HTML 标记原样 ...
- [Python基础]Python中remove,del和pop的区别
以a=[1,2,3] 为例,似乎使用del, remove, pop一个元素2 之后 a都是为 [1,3], 如下:http://Novell.Me >>> a=[1,2,3] &g ...
- 【js基础修炼之路】— null和undefined的区别
在近期的复习期间遇到null和nudefined,于是通过查找资料,想写一篇文章来说明他们的区别.. javaScript高级程序设计: 在使用var声明变量但未对其加以初始化时,这个变量的值就是un ...
- js基础篇——call/apply、arguments、undefined/null
a.call和apply方法详解 call方法: 语法:call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象 ...
随机推荐
- 根据dwarfdump、Symbolicatecrash查找错误代码
dSYM文件获取:1.build2.Archive 获取app UUID 命令:dwarfdump --uuid YourApp.app.dSYM 1.YourApp.app/YourApp2.You ...
- NPAIRS框架的理解
<The NPAIRS Computational Statistics Framework for Data Analysis in Neuroimaging> Strother. pe ...
- erlang 线上分析工具集锦
1.Recon-Erlang线上系统诊断工具(引自): Erlang系统素以稳定可靠闻名,但是它也是c实现的,也是要管理比如内存,锁等等复杂的事情,也会出现Crash,而且crash的时候大部分原因是 ...
- .gitignore的使用:首次创建及事后添加无法生效.
问题:使用sourceTree做版本管理后, Xcode工程每次打开, 都会有几个xcodeworkspace之类的文件提示改动了. 如果想ignore掉, 有两种情况: 1:整个工程没有纳入版本管理 ...
- shell中for循环总结
关于shell中的for循环用法很多,一直想总结一下,今天网上看到上一篇关于for循环用法的总结,感觉很全面,所以就转过来研究研究,嘿嘿... 1. for((i=1;i<=10;i++));d ...
- Delphi 712操作word
//导出Wordprocedure TFrm_Computing.ExportWord;var wordApp, WordDoc, WrdSelection, wrdtable, wrdtable1, ...
- 在Ubuntu下安装Apache
在Ubuntu下安装软件其实非常方便,Ubuntu提供了apt-get工具,可以使用该工具直接下载安装软件. 在Linux里,系统最高权限账户为root账户,而默认登录的账户并非root账户,例如不具 ...
- codeforces 700C Break Up 暴力枚举边+边双缩点(有重边)
题意:n个点,m条无向边,每个边有权值,给你 s 和 t,问你至多删除两条边,让s,t不连通,问方案的权值和最小为多少,并且输出删的边 分析:n<=1000,m是30000 s,t有4种情况( ...
- Chrome的网络调试
F12 然后
- JAVA中的数据结构——集合类(序):枚举器、拷贝、集合类的排序
枚举器与数据操作 1)枚举器为我们提供了访问集合的方法,而且解决了访问对象的“数据类型不确定”的难题.这是面向对象“多态”思想的应用.其实是通过抽象不同集合对象的共同代码,将相同的功能代码封装到了枚举 ...