To attach it to an element, say by the name of "myelement"
code
<div id="myelement">Swipe here!<>
<script type="text/javascript">
$("#myelement").swipe({
swipe: function(event, direction, distance, duration, fingerCount) {
$(this).text("You swiped myelement: " + direction );
}
});
</script>
/code
Have a look at what the function returns - what type of object and does it supply you with the properties that you are looking for. For example swipe returns you
swipe ( EventObject event, int direction, int distance, int duration, int fingerCount, object fingerData )
More information on the swipe event is available here
http://labs.rampinteractive.co.uk/tou...
If you are adding items dynamically then probably your event listener may not work . A work around is to attach the event listener to the parent element instead.
Btw as for the positioning of the list item differently - I'd say you must give it a try. You'll probably find it harder than you think. One way would be to have 2 identical list boxes placed beside each other. Then if you swipe one item then make it visible in the left side list item group and hide it in the right side list item group.