While using iframe, tapping a button causes scrolling to page top involuntarily
Hello all,
iphone4(ios4.31). Tapping a button causes scrolling to page top involuntarily.
This is how the trouble occurs;
Kill Safari process.
Run Safari, open frame.html and tap [move pageB].
Scroll down and tap [move pageA].
Then you'd be jumped to page top and the [move pageA] button doesn't work anymore.
Page reboot can resolve this trouble sometimes.
After killing and rerunning Safari process, you'll face it in high ratio.
I am in deep trouble and begging for your kindness!
- <html>
- <head>
- <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
- <meta name="format-detection" content="telephone=no" />
- <style type="text/css">
- html,body {
- margin: 0;
- padding: 0;
- }
- </style>
- <title>frame</title>
- </head>
- <body>
- <iframe id="frame1" src="main.html" style="width: 100%; height: 400px; display: block; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "></iframe>
- </body>
- </html>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
- <title>main</title>
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"></script>
- <script type="text/javascript">
- $(document).bind("mobileinit", function(){
- $.extend( $.mobile , {
- ajaxFormsEnabled: false,
- });
- });
- </script>
- <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
- </head>
- <body>
- <div data-role="page" id="A">
- <div data-role="content">
- <form action="main.html#B" method="post">
- page A
- <button id="movePageB" type="submit">move pageB</button>
- </form>
-
- </div>
- </div>
- <div data-role="page" id="B">
- <div data-role="content">
- page B top
- <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
- <form action="main.html#A" method="post">
- <button id="movePageA" type="submit">move pageA</button>
- </form>
- </div>
- </div>
- </body>
- </html>