Fixing jumping to top iframe bug on iOS devices

Posted on

in

,

Original source: https://stackoverflow.com/questions/34766636/ios-browser-iframe-jumps-to-top-when-changing-css-or-content-using-javascript

I learnt today that iphones and iframes are not a good combo. Never the less it is combo you will run into if you build elearning modules for mobile. At least the fix is simple. Add this css to the iframed page

html, body {
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

About me

Mark Wong is a front end developer with 10+ years experience. Most of his knowledge of HTML5, CSS and Js is self taught.

Calendar

April 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930