如何使用响应式iframes使iframe响应.js
How to make an iframe responsive with responsiveiframes.js
我正在测试响应式iframes.js为了使iframe响应,iframe内部的比赛没有响应。
如何使其响应式? iframe 中的内容必须是响应式的吗? 有没有其他选项可以使 iframe 响应式(jquery 或其他东西)?
多谢。
这是我的代码
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>ResponsiveIframes.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="http://npr.github.io/responsiveiframe/bootstrap/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="http://npr.github.io/responsiveiframe/bootstrap/css/bootstrap-responsive.min.css" type="text/css" />
<!-- Homepage CSS -->
<link rel="stylesheet" href="css/index.css" type="text/css" media="screen, projection" />
<script src="http://npr.github.io/responsiveiframe/js/ios-orientationchange-fix.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script type="text/javascript" src="http://npr.github.io/responsiveiframe/js/jquery.responsiveiframe.js"></script>
</head>
<body lang="en">
<div class="hero-unit bg-noise">
<h1>Responsive IFrames</h1>
</div>
<script type='text/javascript'>
$(function () {
$('iframe').responsiveIframe({xdomain: '*'});
});
</script><div class='row-fluid contentArea'>
<div class='span8'>
<div style='padding: 10px 0 10px 0; background-color: white;'>
<iframe src='http://www.cuandoenelmundo.com/' style='width: 100%; height:1000px; padding: 0px;margin: 0; border: none; display: block; overflow: hidden;' />
</div>
</div>
</div>
</body>
</html>
我试图让响应式框架.js自己工作,但我放弃了并编写了自己的JavaScript插件(https://github.com/jcharlesworthuk/reactive.iframes,这里的例子)。
从本质上讲,iframe 内的内容本身不必响应,但它必须将其高度传达回父级,以便可以设置高度样式。 如果您无法控制 iframe 内内容的高度,那么仅使用 CSS 真的没有任何解决方案。
相关文章:
- 一旦接收到iFrame的响应,就捕获该响应
- 嵌入 iframe 不会返回响应式设计
- 如何使 iframe 中的内容响应式
- 如何在跨域中创建响应式iframe
- 如何访问 iframe.contentDocument 以在跨源请求后获得响应
- 异步表单w/Iframe Target——OnLoad适用于FF、Chrome、IE9,不适用于;无法在IE7中得到响应
- dojo/request/iframe中读取xml响应的缺陷
- Youtube iframe没有响应通过上图传递的指针事件的点击:none
- iframe响应为302时重新加载应用程序
- 如何记录Apache Cordova应用程序中加载的iframe的http响应
- 显示微调器,直到 iframe 加载 http post 响应
- 检测 iframe 网页是否响应
- 在 Iframe 中发布服务器响应
- 如何使用 Javascript 从 iFrame 响应中设置隐藏字段值
- 如何使用响应式iframes使iframe响应.js
- 如何获取提交表单的 Iframe 的响应
- 如何直接从响应中将 html 和 css 渲染到 iframe 中
- 在 iFrame 中引导响应
- 从 iframe 中的 HTML 表单响应调用父页面
- 基于父容器大小的响应iframe src参数