single finger double tap

5 views
Skip to first unread message

Excell

unread,
Dec 23, 2010, 11:13:46 PM12/23/10
to iPhoneWebDev
Hi all

Can anyone help

Is the a way to prevent the screen moving to the center where you have
double tapped

I have tried using preventDefault() on the whole document but that
causes me problems elsewhere

Many thanks

Roger [Excell]

Chrilith

unread,
Dec 24, 2010, 2:37:07 AM12/24/10
to iPhoneWebDev

> Is the a way to prevent the screen moving to the center where you have
> double tapped

Double tap usually mean "zoom" with Mobile Safari.

>
> I have tried using preventDefault() on the whole document but that
> causes me problems elsewhere
>

If you want to design an webapp meant to work on iOS devices you
should use the "viewport" meta tag to constraint the behavior of your
pages.
For instance:

<meta name="viewport" content="width=device-width; initial-scale=1.0;
maximum-scale=1.0; user-scalable=0;" />

This will prevent zoom whether using double tap or pinch.

Excell

unread,
Dec 24, 2010, 2:41:34 AM12/24/10
to iPhoneWebDev
Thanks for the response

but i have that meta tag in place

this double tap (quick tap) forces the tapped area into the center of
the screen
so it is a scroll.

I have a oversize div which i am using a touchmove to navigate around
so a real scroll it a real problem.

Peter Rust

unread,
Dec 24, 2010, 12:19:06 PM12/24/10
to iphone...@googlegroups.com
You might look at using iScroll from cubiq -- it does the "oversize div w/
touchmove navigation" and it works very well, there was even an iUI build at
one point that had iScroll integrated.

My guess would be that your problem either lies with the viewport tag, as
Chrilith mentioned, or with the content (having content larger than the
viewport, or perhaps needing to cancel a native event in some situations --
not that that exactly narrows things down very much. But the iScroll code
has already dealt with all these things, so I'd encourage you to use it, if
at all possible: http://cubiq.org/iscroll

-- peter

Thanks for the response

--
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to iphone...@googlegroups.com.
To unsubscribe from this group, send email to
iphonewebdev...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en.

Reply all
Reply to author
Forward
0 new messages