disable safari bounce effect on a remote url

You must Login before you can answer or comment on any questions.

I'm loading a remote url inside a webview, and I need to disable the safari bounce effect on it. I tried to load the e.preventDefault() on the beforeload and load event, but with no effect:

webview.addEventListener("load", function() {
    webview.evalJS("'document.addEventListener('touchmove', function(e) { e.preventDefault(); }, false);'");
 
})
I even tried to load a local html file with an iframe containing the remote page, but if I put the iframe inside the page, the preventDefault stops working:
<head>
<script type="text/javascript">
document.ontouchmove = function(e){
             e.preventDefault();
}
</script>
</head>
<body>
<IFRAME SRC="http://www.google.com" width="768" height="800">
 
</IFRAME>
</body>
I'm stuck. Does anyone manage to solve this? I have looked through the Q&A but I didn't get any answer.

platform: iOS TiSDK: 1.8.x

1 Answer

did you try modifying the DOM of the page after it is loaded it to included the code included above?

— answered 12 months ago by Aaron Saunders
answer permalink
1 Comment
  • I forgot to say that I dont have direct access to that page (urls like google.com, etc) Sorry, I had to write the question twice, I got a 403 error the first time, and I missed out something afterwards

    — commented 12 months ago by Alberto Marcone

Your Answer

Think you can help? Login to answer this question!