< Back to Coding, HTML

Fixing jumping to top iframe bug on iOS devices

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 *