So, I have an element that looks like this:
____________________________________ / \ | | | | +------------------------------------+ | | | | | | +------------------------------------+ | | | | \____________________________________/
I connected a touchstart listener to it, for example:
other_options.addEventListener('touchstart', function(e) { event.preventDefault(); }, false);
What I want to do, and I have already looked at the values โโof "e", but I can not find any value that is consistent enough (the values โโseem to me wrong when I try to) to do what I want.
I know the size of these lines. I just want to be able to take the Y coordinate where the touchstart event occurred, 0 is the top coordinate of the element. So Math.floor (y / ROW_SIZE) will give me the line where the touchstart event was fired.
javascript html html5
h4lc0n
source share