【文件属性】:
文件名称:iframe_height:跨域 iframe 高度调整
文件大小:4KB
文件格式:ZIP
更新时间:2021-06-16 21:33:14
HTML
iframe 高度
iframe 高度是一个允许跨域消息传递的简单工具,特别是针对响应式设计调整 iframe 高度的大小。
用法
将 parent.js 文件添加到包含页面,将 child.js 添加到包含页面。
在父页面中调用:
IframeResize.load(选项);
下面定义的配置选项。
在子页面中,从您的文档就绪函数或窗口加载函数调用 messageParent()。 messageParent 函数尝试使用 document.scrollHeight 来获取文档的高度,但这并不总是适用于每个人。 您可能只想使用 jquery 或其他选择器获取给定元素或主体的高度。
配置选项
Options : {
src : '' // The source url that the iframe is going to load
element : '' // The id
【文件预览】:
iframe_height-master
----demo.html(323B)
----child.html(3KB)
----README.md(1KB)
----child.js(384B)
----parent.js(2KB)