禁用iframe自动调整大小 [英] disable iframe auto resize

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

问题描述

我正在使用其中包含iframe的网页。 iframe中有相当数量的数据,并且每次加载其高度都会扩展到其中的内容范围。然而,这将我的页面。反正是否有锁定iframe的高度并允许用户滚动内容?

I am working with a webpage with an iframe within it. The iframe has a fair amount of data in it and every-time it loads its height expands to the extent of the content within. However this puts my page out. Is there anyway to lock the height of the iframe and allow the user too scroll through the content??

推荐答案

嗯,很奇怪。 ..你有这个问题的示例链接吗?

Hmm, weird... do you have an example link of this issue?

当我尝试一个简单的iframe时:
http://jsfiddle.net/mP6wT/5/

When I try a simple iframe: http://jsfiddle.net/mP6wT/5/

<iframe src="http://example.org/"></iframe>

默认情况下,它的大小似乎相当小,并在Chrome / FF / Win中滚动...而不是调整到高度...

It seems to be sized pretty small by default, and scrolls in Chrome/FF/Win... Rather than adjusting to the height...

但无论如何,你应该能够用CSS锁定高度:
http://jsfiddle.net/mP6wT/7/

But at any rate, you should be able to lock the height with CSS: http://jsfiddle.net/mP6wT/7/

<iframe src="http://example.org/" style="height:400px;"></iframe>

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

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