xui.js swipe plugin - how to get element id

365 views Asked by At

i'm using xui in a photegap project as it's going pretty well except that, when using the swipe plugin, I can't find a way to get the tapped element id attribute.

Can anyone help me on thie one?

Thanks

1

There are 1 answers

0
fil maj On

The callback that you pass into the swipe method gets passed the touch event object as the first parameter.

As such, you can check out the Touch Event documentation, especially the touches array of Touch objects; these Touch objects have a target attribute that gives you a direct reference to the element that the touch event started on.