safari - stop background of iphone webapp from responding to swipes -


I am creating a mobile version of my website, and am trying to feel it as originally as possible on the iPhone . However, areas with any background on the page respond to swipe gestures, so that you can move the page away from the screen. Specifically, if the user touches and swipe to the left, for example, the content changes from the edge of the screen and a page can see the 'white background' behind the page. How can this be prevented? I want to 320x480 the page with scroll-swiping disabled (except list elements that I have selected).

I've added the following meta tag at the top of the page:

   & Lt; Meta name = "apple-mobile-web-app-enabled" content = "yes" /> & Lt; Meta name = "apple-mobile-web-app-status-bar-style" content = "black" />  

I have also made the following attempts as an event handler for touchtaste, touch-movement, and missing events of body elements:

  function Cancel TouchEvent (e) {If (! E) var e = window.event; E.cancelBubble = true; If (e.stoppropation) e.stopprogication (); If (e.preventDefault) e.preventDefault (); return false; }  

This does not stop swiping behavior, but prevents clicks on all links on the page ...

Any help is greatly appreciated. Thanks!

I had the same problem, but on the iPad, and whoever was not the problem in the general case I have been able to solve, but I believe I have come up with a solution that works.

Solution (in javascript) -

  Document.addEventListener ('touchmove', function (e) {if (e.preventDefault) {e.preventDefault ();} });  

Simple, no? This works by preventing default behavior on the ' touchhove ' event, so background swiping is not done. This does not affect fake click events.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -