Search code examples
cssiframemobile-safari

Loading responsive website inside iframe


I am loading a responsive website inside a dynamic iframe on Mobile Safari, I set the width of the iframe via JS to the viewport width and you can see the responsive layout for a second, then the iframe "explodes" to the right and down and the desktop version is loaded. I tried this with a couple of websites and the results is the same.

Why is it loading the desktop version and how can I force the iframe to load the mobile version instead?

Update:

It seems it might be due to the library I am using for the popup in which I am loading the iframe (Magnific popups), I added an iframe to the body of the page and it doesn't have that problem.


Solution

  • Added scrollable: no to the iframe fixed it. Usual voodoo of HTML/CSS.