关于touch 事件
-
“touches”, optional and defaulting to [], of type Touch[], that is a list of objects for every point of contact currently touching the surface. touchstart 中存在值
-
“targetTouches”, optional and defaulting to [], of type Touch[], that is a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event. 会在touchstart/touchmove中有值
-
“changedTouches”, optional and defaulting to [], of type Touch[], that is a list of objects for every point of contact which contributed to the event.只有当触摸点变化了这里才会有值,但是有的只是变化的那个点的值 touchend会触发,touchmove中只有点变化这里才有值
检查设备是否支持touch
navigator.maxTouchPoints > 0