iframe Scrolling Issues

81 views
Skip to first unread message

abut...@buildfire.com

unread,
Feb 9, 2017, 3:25:26 PM2/9/17
to phonegap

I've made slight changes to a hello world Cordova app, to include an iframe and some basic CSS. For some reason when I scroll down the page, then wait about 5 seconds, the contents of the iframe bump back to the top of the page. I've tried this with multiple URLs, and am able to reproduce with varying degrees. It's possible that the site in the iframe is affecting this, although if I test the URLs directly in a web browser the issue isn't reproducible.

Is it possible that the Cordova in app browser is something affecting this? 

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"><meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<style>
html{
width:100%;
min-width:100%;
max-width:100%;
height:100%;
overflow:hidden !important;
}
html body{
height:100% !important;
width:100% !important;
overflow-y:auto !important;
-webkit-overflow-scrolling:touch !important;
}
</style>
<title>Hello World</title>
</head>
<body>

<div>
<iframe style="height:100%; min-width:100%;" scrolling="auto" src="http://buildfire.com"></iframe>
</div>

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>

Steve Husting

unread,
Feb 10, 2017, 10:30:09 AM2/10/17
to phonegap
Perhaps you are only experimenting with this, but ...

Do you know that Apple does not allow apps which are simply a website on the screen? Google Play probably will downvote it as well.

At any rate, I don't know why this iframe issue is happening, but Cordova uses a plugin called inappbrowser that is a great substitute.
Reply all
Reply to author
Forward
0 new messages