touches, targetTouches, changedTouches 区别
1. touches: A list of information for every finger currently touching the screen
2. targetTouches: Like touches, but is filtered to only the information for finger touches that started out within the same node
3. changedTouches: A list of information for every finger involved in the event (see below) To better understand what might be in these lists, let’s go over some examples quickly
They vary in the following pattern:
1. When I put a finger down, all three lists will have the same information. It will be in changedTouches because putting the finger down is what caused the event.
第一根手指触摸屏幕,三个事件获取的值相同。
2. When I put a second finger down, touches will have two items, one for each finger. targetTouches will have two items only if the finger was placed in the same node as the first finger. changedTouches will have the information related to the second finger, because it’s what caused the event
第二根手指触摸屏幕,此时touches获取两个触摸点的信息。若触摸点在同一个对象上,targetTouches也获取两个触摸点的信息。changedTouches只保存第二个触摸点的信息。
3. If I put two fingers down at exactly the same time, it’s possible to have two items in changedTouches, one for each finger
若同时用两根手指触摸屏幕,changedTouches 有两个列表分别表示两个触摸点的信息。
4. If I move my fingers, the only list that will change is changedTouches and will contain information related to as many fingers as have moved (at least one)
如果移动触摸点,只有 changedTouches 会记录每个移动的触摸点信息
5. When I lift a finger, it will be removed from touches, targetTouches and will appear in changedTouches since it’s what caused the event
当一个触摸点离开,它的信息列表将从touches,targetTouches移除,但是changedTouches会保存此触摸点信息。
6. Removing my last finger will leave touches and targetTouches empty, and changedTouches will contain information for the last finger
最后一个触摸点离开,touches,targetTouches变成空值,而 changedTouches保存着最后一个离开的触摸点信息。
参考地址:
touches, targetTouches, changedTouches 区别的更多相关文章
- 关于TouchEvent里面的touches,targetTouches,changedTouches的解释
touches:手指触摸到屏幕上引起的当前所有触摸点的集合; targetTouches:手指触摸到绑定事件的节点上的触摸点的集合; changedTouches:触摸事件时改变触摸点的集合; 以下 ...
- js中触摸相关变量touches,targetTouches和changedTouches的区别
touches: 当前屏幕上所有触摸点的列表; targetTouches: 当前对象上所有触摸点的列表; changedTouches: 涉及当前事件的触摸点的列表 通过一个例子来区分一下触摸事件中 ...
- TouchEvent里的targetTouches、touches、changedTouches的区别的具体体现是?
touches:当前屏幕上所有触摸点的集合列表 targetTouches: 绑定事件的那个结点上的触摸点的集合列表 changedTouches: 触发事件时改变的触摸点的集合 举例来说,比如div ...
- Touch事件详解及区别,触屏滑动距离计算
移动端有四个关于触摸的事件,分别是touchstart.touchmove.touchend.touchcancel(比较少用), 它们的触发顺序是touchstart-->touchmove- ...
- html5手机常见问题与工具分享
mobileTech A useful tools or tips list for mobile web application developing 这个项目收集移动端开发所需要的一些资源与小技巧 ...
- HTML5的touch事件
HTML5中新添加了很多事件,但是由于他们的兼容问题不是很理想,应用实战性不是太强,所以在这里基本省略,咱们只分享应用广泛兼容不错的事件,日后随着兼容情况提升以后再陆续添加分享.今天为大家介绍的事件主 ...
- (任寒韬)WebApp群主 - MobileTech 资料
web app : http://www.lightapp.cn/brand/index/4101 https://github.com/jtyjty99999/mobileTech/blob/mas ...
- webAPP前端必备知识
了解各浏览器内核 Firefox:-moz-box-shadow Safari:-webkit-box-shadow Opera:-o-box-shadow IE:-ms-box-shadow Web ...
- 转。webapp开发小tips
备忘 - Q: webapp点击一个按钮调用系统拨号: <a href="tel:12345654321">打电话给我</a> <a href=& ...
随机推荐
- IQueryable,IEnumerable,List相互转换
发个文记录一下犯的错误吧!!! 如果在使用ASP.NET MVC很多的数据存取都是以IQueryable<>泛型类接收,那么在做两个IQueryable<>集合拼接时对于新手可 ...
- 1001. 害死人不偿命的(3n+1)猜想 (15)
1001. 害死人不偿命的(3n+1)猜想 (15) 较简单,直接代码实现: #include <cstdio> int main() { int n; scanf("%d&qu ...
- 黄聪:《跟黄聪学WordPress插件开发》
续<跟黄聪学WordPress主题开发>之后,又一个作品完成!<跟黄聪学Wordpress插件开发>,国内最好的Wordpress插件开发视频教程!! 目录预览: WordPr ...
- ext4 disable journal
ext4 disable journal At one high loaded web project I needed a very fast file system. I decided to u ...
- Error #2044: 未处理的 IOErrorEvent:。 text=Error #2035: 找不到 URL这是flash加载外部资源时有时会遇到的问题,对于此问题解决如下
导致这个错误的主要原因是未添加IOErrorEvent事件监听,或者添加了监听,但是加载时使用了unload() 参考资料: http://blog.csdn.net/chjh0540237/arti ...
- linux默认编辑器 sublime
开发人员把Vi improved简称Vim Vim编辑器再内存缓冲区中处理数据. 如果再启动Vim时未指定文件名,或者这个文件不存在,Vim会新开一段缓冲区域来编辑. 如果你再命令行下指定了一个已有文 ...
- [转载]《民航科技》2012年4月专家论坛:程延松《关于中国民航SWIM框架及技术实现探讨》
专家介绍:程延松,现任成都民航空管发展有限公司总经理,理学博士,高级工程师,长期从事空管技术研究和产品研发工作,作为课题负责人,参与了国家863计划.国家科技支撑计划.国家空管委重点课题.民航局重点课 ...
- js 循环
//数组循环var a = [1, 2, 3, 4, 5, 6];for (var i = 0, l = a.length; i < l; i++) { console.log(a[i]);} ...
- 统计在从1到n的正整数中1出现的次数
问题: 给定一个十进制正整数N,写下从1开始,到N的所有整数,然后数一下其中出现的所有“1”的个数. 例如:N= 2,写下1,2.这样只出现了1个“1”. N= 12,我们会写下1, 2, 3, 4, ...
- ios 给图片添加水印
//第一种添加水印方法 -(UIImage *)watermarkImage:(UIImage *)img withName:(NSString *)name{ NSString* mark = na ...