Here's a code snippet from an app I'm writing. You can also access
pageY for the corresponding y-axis value. If you're using Dashcode
(provided with the iPhone SDK), you can debug, test, and attach event
handlers to these events (they're listed there for you. Very nice).
Hope it helps.
Luke Hartman
-------------------------
var xStart;
var xCurrent;
function touchStart(event)
{
xStart = event.touches[0].pageX;
}
function touchMove(event)
{
xCurrent = event.touches[0].pageX;
xPixelsMoved = xCurrent-xStart;
alert("current X = " + xCurrent + " and xPixelsMoved = " +
xPixelsMoved);
}
On Jul 2, 7:52 pm, Ahrjay <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> Since apples documentation on this is still pretty much nothing. I was
> wondering if anyone has found a way to detect the users finger
> position based on where they touch or swipe through the javascript
> events available in the 2.0 software. I can get it to return the
> position if I do event.pageX to a onmousedown event but can't get the
> position when attached to a ontouchstart, ontouchmove & ontouchend
> events. Has anyone got this to return the users position?
>
> Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---