In developer tools I can see that touchmove
event is fired multiple times while performing finger move*.
I'm looking for solution that should move div
on which touchmove is performed - for exact number of touch move pixels, for either one or both axis.
What have I done so far?
I've tried to bind anonymous function to div
's touchmove
event, expecting that e
argument of anonymous function will have something like offsetX
& offsetY
like mousemove do, so I could update position parameters of div
accordingly.
Something like this:
$('div').on('touchmove', function(e){
console.log(e);
//e has no offset or similar param known to me
});
No results.
What should I do instead?
Special appeal: I will upvote any working solution, but accepted answer goes to the one that will give me at least a starting point about what should I do in plain JavaScript, without abstractions like jQuery mobile.
* I'm actually doing cursor touch emulation in Chrome dev tools