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=& ...
随机推荐
- WCF部署于IIS使用的几个问题总结
Q:wcf 远程服务器返回错误: (405) 不允许的方法. A: new SqlServerOperateClient("BasicHttpBinding_ISqlServerOperat ...
- c++中处理输入输出的方法
============ 怎么处理一行空格中的逗号, ,,, ,,, ,,, c,c,d,d 使用c++的方法,可以这么处理: #include <sstream> #include< ...
- json 与jsonp 特点及区别
简单描述JSON跟JSONP的区别以及实战 什么是JSON? 前面简单说了一下,JSON是一种基于文本的数据交换方式,或者叫做数据描述格式,你是否该选用他首先肯定要关注它所拥有的优点. JSON的优点 ...
- MFC与C#连接MYSQL乱码问题
MYSQL数据库编码为:latin1 问题现象:插入中文乱码,及用中文作参数无法得到相应数据 如select * from userinfo where username='李小明' MFC中解决方法 ...
- mysql 笔记
mysql配置主从复制的时候,不能将server-id设置成非数字,这样会导致mysqld启动失败. mysql重启的时候,自动会释放锁(这个锁应该是位于内存的) 执行sql脚本:source /ho ...
- 采用CAS原理构建单点登录
企业的信息化过程是一个循序渐进的过程,在企业各个业务网站逐步建设的过程中,根据各种业务信息水平的需要构建了相应的应用系统,由于这些应用系统一般是在不同的时期开发完成的,各应用系统由于功能侧重.设计方法 ...
- CentOS下Apache开启Gzip网页压缩功能
1.进入/etc/httpd/conf下打开httpd.conf文件 开启Gzip压缩功能,即去掉LoadModule deflate_module modules/mod_deflate.so这行前 ...
- dom4J 学习
Java给我们提供了标准的W3C接口实现,已完成对XML的处理.主要有两大类,分别是DOM操作,SAX解析.DOM可以将XML加载到内存中,对XML进行方便的增删查改.由于是将整个XML都加载到内存中 ...
- selenium 关于富文本的处理
http://www.cnblogs.com/xiaobaichuangtianxia/p/5889999.html
- virtualBox 打开旧的ubuntu虚拟机镜像时找不到网卡的解决方法
一 环境: ubuntu v8.04 virtualbox _v4.3 二 操作 1 按正常创建新的虚拟机, 然后在选择虚拟硬盘界面选择使用旧的ubuntu虚拟机 2 打开虚拟机 删除/etc/ude ...