javascriptandroidtouchtouchstarttouchmove

how to use touchmove to complement mousemove for androids


What difences should i be aware of when tring to complement a working function that use mouse move in to also work on smartphones.

So far have i learned that on my android i get

But it's not enough, the code still misbehave, what more should i learn before i can get it to work?

The exemple: http://paint.puggan.se/paint/paint_201305311921.html

When you drag from one point to another in the same group, its adds a yellow line between them. While still draging its paints a blue line to the closest, if you drag close or stop(mouse up) its adds the yellow line.

Above works fine with mouse in firefox for my computer.

Above dosn't work on my android, i can see blue lines, but never any yellow lines


Solution

  • Learned another diferences, and now it works.

    When the touchend trigger, the list event.touches is empty, and therefor the event.touches[0] fails.

    working version of exemple above http://paint.puggan.se/paint/paint_201306011919.html