html5 - How to get element from a DIV container by points in javascript? -


i have created 5 number of div's in ".container" div element bellow;

<div class="container">    <div class="elem1">no 1</div>    <div class="elem2">no 2</div>    <div class="elem3">no 3</div>    <div class="elem4">no 4</div>    <div class="elem5">no 5</div> </div> 

touchstart, touchmove , touchend event has assigned .container element.

on touch start of container in .elem1, touchstart event handler receive "elem1" in event.target.

on touch end of container in '.elem4' touchend event handler receive "elem1" in event.target release touch in elem4. problem. need elem4 here.

how exact element on touchend event handler? solution / suggestion on using touch points?

are using jquery listen touch events? similar this: jsfiddle. essentially, i'm listening touch events on touch class itself, pulling specific data id. substitute id, data-attribute or innerhtml. event bubbling can hairy , solution has worked me in past.

p.s. did know can emulate touch events in google chrome? check out page!


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -