根据内容高度自动调整iframe大小 [英] Auto-resize iframe based on content height

查看:111
本文介绍了根据内容高度自动调整iframe大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上有一个网站,它从我无法访问的外部网站中提取iframe。

I have a site on my server that is pulling in an iframe from an external site in which I do not have access.

我希望iframe根据所提取的内容调整高度,以使整个页面看起来像一个页面。

I want the iframe to resize the height based on the content that is being pulled in so the page as a whole looks like a single page.

*我不需要知道如何摆脱滚动条。

*I do not need to know how to get rid of the scroll bars.

有没有人有任何想法?提前致谢!

Does anyone have any ideas? Thanks in advance!

推荐答案

我不认为这是可能的。无法使用JavaScript与iframe交互。这会产生严重的安全后果,因此浏览器不允许这样做。

I don't think it's possible. There is no way to interact with an iframe with JavaScript. That would have serious security consequences so browsers don't allow it.

这篇关于根据内容高度自动调整iframe大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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