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 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930