javascript - Detecting touchstart while detecting touchmove -
javascript - Detecting touchstart while detecting touchmove -
i've been plugging away @ project , until i've been using chromes debugger mobile emulator. means i've been able simulate touches , dragging behaviors mouse. unfortunately because of having 1 mouse never both @ same time.
the project i'm working on adds 2 half-page sized dom elements page, 1 on left has touchmove event listener tied it, , other on right has touchstart event listener tied it. both work swimmingly.
but tonight uploaded project online test stuff out , opened ipad , found perform 1 action @ time. page not observe touchstart events on right while touchmoved on left, , likewise couldn't observe touchmove events on left while tapped on right.
anyone done before? detecting different sets of touches on separate dom elements?
code snippets bit big include here link github repo here: https://github.com/matthewolsson/joyshtick
dom elements share single touches array. prior phase of testing under assumption individual dom element had touch listener applied had own array of relevant touches. know every element on page, regardless of listeners, contributes 1 singular touches array stores , current touches on page.
knowing i've rectified situation using targettouches touchlist. link gives summary basics single array of touches populated touches occur within dom element first 1 began in.
you can find fantastic explanation of list here ~ (stackoverflow.com/questions/7056026/variation-of-e-touches-e-targettouches-and-e-changedtouches). lastly not to the lowest degree w3c has detailed page on touch event , of features.
javascript mobile touchstart touchmove
Comments
Post a Comment