Loading responsive website inside iframe

江枫思渺然 提交于 2019-12-12 03:59:40

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/32429655/loading-responsive-website-inside-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!