问题
I am currently developing an application using phonegap,jquery mobile for multiple platforms. I have searched a lot to disable the overscroll effect in phonegap. As per my search this can be achieved by setting the preferences in confix.xml
<preference name="DisallowOverscroll" value="true" />
Also i have used the javascript code for allowing the body scroll but this is not working properly. Below is the code that i used to allow the body scroll.
.scrollable {
overflow: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
.scrollable * {
-webkit-transform: translate3d(0,0,0);
}
document.body.addEventListener('touchmove',function(e){
if(!$(e.target).hasClass("scrollable")) {
e.preventDefault();
}
else
{
console.log("Scrollable");
}
});
Is there any way to solve this issue out
回答1:
If you are using phonegap, I found I had to actually fully uninstall the app and re-install it for the change in config.xml to take effect and stop the overscrolling.
来源:https://stackoverflow.com/questions/17530019/ios-phonegap-disallow-overscroll-not-working-properly