drag and drop → Особенности Drag and Drop для Тачскринов
При огранизации drag&drop в обычном случае пользуються события onmousedown, onmousemove, onmouseup. Но при такой организации на тачскринах наш drag&drop не работает. Для тачскринов есть другие события onTouchStart, onTouchMove,onTouchEnd и onTouchСancel. Особенность в том, что в объекте event передаеться несколько пальцев… Собственно первый палец:
var touch = e.touches[0]
свойства пальца:
- clientX: X coordinate of touch relative to the viewport (excludes scroll offset)
- clientY: Y coordinate of touch relative to the viewport (excludes scroll offset)
- screenX: Relative to the screen
- screenY: Relative to the screen
- pageX: Relative to the full page (includes scrolling)
- pageY: Relative to the full page (includes scrolling)
- target: Node the touch event originated from
- identifier: An identifying number, unique to each touch event