通过iframe模拟移动屏幕尺寸 [英] Emulating a mobile screen size through an iframe

查看:124
本文介绍了通过iframe模拟移动屏幕尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是一个随意的想法,
如果我不想展示响应式网页设计,而不是通过调整浏览器窗口的大小,而是实际上将响应式网站加载到具有与移动屏幕相同尺寸的IFRAME中,该怎么办?可以这样做吗?

Just a random thought, What if I wanted to showcase a responsive webdesign not by resizing the browser window, but actually loading the responsive site in an IFRAME having the same dimension as that of a mobile screen. Can this work?

假设我有一个IFRAME

assuming that I have an IFRAME

<iframe src="something" id="viewPort"/>

我在其中加载了响应式网站。然后让用户通过在浏览器中调整iframe的宽度和高度进行测试。

into which I load the responsive website. and then let the user test by adjusting the iframe width and height in their browser.

如果这行得通,对于不了解某事的客户来说可能是一个福音关于浏览器。

IF this can work it can be a boon for clients who don't know a thing about browsers.

推荐答案

我赢了:)有一个众所周知的,您可以使用也可以学习。

I win :) There is one, well known, you can either use or learn from.

http://mattkersley.com/sensitive/

更具体地说, iframe 确实允许您更改高度宽度及其内容确实对此做出了响应-也就是说- @media 可行。

To be more specific, iframe absolutely does allow you to change height and width and its content does respond to that - that is to say - @media works.

这篇关于通过iframe模拟移动屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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