包含嵌入/发布的Google文档的Iframe的自动高度 [英] Auto height for Iframe containing embedded / published Google Doc

查看:148
本文介绍了包含嵌入/发布的Google文档的Iframe的自动高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已发布Google Doc的iframe。该文档的内容可能会发生变化,所以我想根据其内容自动调整iframe的高度。我找到了一些解决方案,但都需要访问子文档的头部。有没有人有关于如何做到这一点的想法?



您可以查看下面我使用的代码的摘录:

  #faq {
height:800px;
overflow:hidden;
职位:亲属;
width:660px;
border-top:1px solid#90C547;
border-bottom:1px solid#90C547;
}

< div id =faq>< iframe id =faqifsrc =https://docs.google.com/document/ .... / pub?embedded = trueframeborder =0style =overflow:hidden; overflow-x:hidden; overflow-y:hidden; height:900px; width:832px; position:absolute; top:-92px; left: -150px;右:0像素;底部:0像素; z索引:0; height =900pxwidth =832px>< / iframe>< / div>


解决方案

目前没有办法做到这一点。



但是,您可以使高度更大并隐藏边框,这样iframe滚动条就不会出现,文档将显示为您网站的一部分。

I have an iframe with a published Google Doc. The contents of that doc are subject to change, so I want to auto adjust the height of the iframe based on its content. I found some solutions for this, but they all require access to the head of the child document. Does anyone have an idea on how to do this?

You can view an excerpt of the code I use below:

#faq{
height: 800px;
overflow: hidden;
position: relative;
width: 660px;
border-top: 1px solid #90C547;
border-bottom: 1px solid #90C547;
}

<div id="faq"><iframe id="faqif" src="https://docs.google.com/document/..../pub?embedded=true" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:900px;width:832px;position:absolute;top:-92px;left:-150px;right:0px;bottom:0px;z-index:0;" height="900px" width="832px"></iframe></div>

解决方案

There's no current way to do this.

You can, however, make the height a lot larger and hide the borders, this way the iframe scrollbar won't appear and the document will appear to be a part of your website.

这篇关于包含嵌入/发布的Google文档的Iframe的自动高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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