How to prevent app running in phone-gap from scrolling vertically? How to prevent app running in phone-gap from scrolling vertically? ios ios

How to prevent app running in phone-gap from scrolling vertically?


if you're using Cordova 2.3.0+ find config.xml and add this line:

<preference name="UIWebViewBounce" value="false" />

or in Cordova 2.6.0+:

<preference name="DisallowOverscroll" value="true" />


Run this code when the page is loaded to disable dragging:

document.addEventListener('touchmove', function(e) { e.preventDefault(); }, false);

Here's an example with jQuery:

$(document).ready(function() {    document.addEventListener('touchmove', function(e) { e.preventDefault(); }, false);});


in your config file use

<preference name="webviewbounce" value="false" /><preference name="DisallowOverscroll" value="true" />