【发布时间】:2015-01-02 00:19:58
【问题描述】:
我正在开发一个运行 Drupal 的移动网站。
目标是将第三方日历软件嵌入到页面中。我试图嵌入的日历恰好是固定宽度的。
下面的 css 使 iframe 和其中的任何响应式内容都能很好地工作,但我靠墙的地方是固定宽度的子页面。
.embed-container {
position: relative;
padding-bottom: 56.25%; /* 16/9 ratio */
padding-top: 30px; /* IE6 workaround*/
height: 0;
overflow: hidden;
}
.embed-container iframe,
.embed-container object,
.embed-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
我对 responsiveiframe.js 进行了一些思考,但这似乎包含第三方子页面的脚本,那么还有其他方法可以使其“响应”/在移动设备上工作吗?
【问题讨论】:
标签: javascript css iframe responsive-design drupal-7