我想根据 Shindig Gadget 内部的内容动态调整其 iframe 的高度。经过一番研究,我发现需要这样的 iframe src
有<!DOCTYPE ...>
使用以下代码声明获取 iframe 内内容的高度:
document.getElementById("iframe").contentWindow.document.body.scrollHeight
但是不可能在 <![CDATA[
中定义文档类型Shinding 模块。实现这一目标的最佳方法是什么?
最佳答案
您应该使用 adjustmentHeight API 来执行此操作。调用不带任何参数的 API 将调整 iFrame 高度以适合其内容。 http://opensocial-resources.googlecode.com/svn/spec/trunk/Core-Gadget.xml#gadgets.window.adjustHeight
关于javascript - 如何动态调整 Shindig Gadget 的 iframe 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12950014/