I\'m trying out phone gap and I want my application to not scroll up and down when the user drags their finger across the screen. This is my code. Can anyone tell me why it\
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);
});
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" />
Add the following entry to config.xml file:
<preference name="DisallowOverscroll" value="true" />
now you just have to put <preference name="DisallowOverscroll" value="false" />
to <preference name="DisallowOverscroll" value="true" />
in your config.xml file.
In config.xml of your project, under preferences for iOS set DisallowOverscroll to true.
If you have UIWebViewBounce to NO in your .plist file.
Then with simple css would make the content not scrollable. Try Adding this style overflow : hidden in your div where you want to disable the scroll.