Doesn't work with Mobile Safari #7

Closed
Frobitz opened this Issue Nov 29, 2010 · 3 comments

Projects

None yet

4 participants

@Frobitz

Despite having touch events in the code this doesn't seem to work at all on Mobile Safari. Indeed, it even prevents scrolling the page with your finger when touching the div used. Can anyone else confirm this problem?

@apatheticresistance

Hi, I'm trying out Overscroll for the first time on a test site, and I can confirm that the Overscrolled element doesn't seem to want to scroll on my iPhone.

@kkriehl

Hello,

this problem originates from the different event format of touch events: Unlike normal mouse events, which store the cursor's x and y coordinates in event.pageX and event.pageY, touch-events can have multiple simultaneous touches and therefore have an array of "touch object" which themselves have the pageX and pageY properties. Additionally overscroll uses the jQuery event wrapper which is not yet ready for touchscreen devices and does not have a property "touches".

To get the touch coordinates from the first touching finger from inside a jQuery event handler you need this code:

event.originalEvent.touches[0].pageX

Because I had the same problem while tuning my scripts for iPad use I patched my copy of overscroll: http://pastebin.com/f608LrqH . This patch includes a click-event-patch because the native touch-to-click mapping from the iPad gets overwritten: If a touchend-event immediately follows a touchstart-event it's considered a click event.

@azoff
Owner

Just fixed in v1.4

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment