ios phonegap disallow overscroll not working properly

耗尽温柔 提交于 2019-12-24 04:49:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!