在iframe中加载响应式网站 [英] Loading responsive website inside iframe

查看:100
本文介绍了在iframe中加载响应式网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mobile Safari上的动态iframe中加载响应式网站,我通过JS将iframe的宽度设置为视口宽度,然后您可以看到响应式布局一秒钟,然后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.

为什么要加载桌面版本,我如何强制iframe加载移动版本?

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

更新:

似乎可能是由于我正在用于加载iframe的弹出窗口的库(宏弹出窗口),我在页面正文中添加了一个iframe,但并没有没有那个问题.

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.

推荐答案

已将scrollable: no添加到固定的iframe中.常用的HTML/CSS巫毒.

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

这篇关于在iframe中加载响应式网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆