There was no offsetX in e.touches[0] when I tried on iPad. Does anyone know where I can get this value of offsetX?
The correct answer based on the comments in the suggested answer:
e.offsetX = e.touches[0].pageX - e.touches[0].target.offsetLeft;
e.offsetY = e.touches[0].pageY - e.touches[0].target.offsetTop;
This ignores any transformations such as rotations or scaling. Also be sure to check if there are any touches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With