在内容加载之前,我可以更改或控制IFRAME区域的颜色吗? [英] Can I change or control the color of the IFRAME area before the content loads?

查看:119
本文介绍了在内容加载之前,我可以更改或控制IFRAME区域的颜色吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

我有一个网站,其中的部分内容加载到IFrame。

I have a site where portions of the content are loaded into IFrames.

我遇到的问题是,iFrame的内部内容是白色的,直到页面本身加载,并且内容有不同的背景颜色案件)。所以我在屏幕上有这些白色方块,直到内容加载。

The problem I'm having is that the inside content of the iFrame is white until the page itself loads, and the content has a different background color (blue, in this case). So I have these white squares on the screen until the contents load.

有没有什么方法来指定什么颜色的空IFrame应该呈现,直到它有内容?

Is there any way to specify what color the empty IFrame should render as until it has content?

或者我在这里采取了错误的方式 - 是否有一个好的方法来保持页面呈现,直到内容准备显示?

Or am I taking the wrong tack here - is there a good way to keep the page from rendering until the contents are ready to be displayed?

UPDATE:看起来我所描述的白色区域位是特定于IE的。

UPDATE: Looks like the "white area" bit I'm describing is IE-specific.

推荐答案

这不太难:

< iframe id =IFRsrc =time.php style =background-color:#f00; />

编辑:我忽略了在IE中测试 - 它在FireFox中工作。示例: http://beta.tagcloud.com/contain.html

I neglected to test in IE -- it does work in FireFox. Example at: http://beta.tagcloud.com/contain.html

该示例演示了页面快速切换到全红色,然后当iframe加载(5秒)时,它将切换到黑色。

The example demonstrates that the page quickly switches to all red, and then when the iframe loads (in 5 seconds), it switches to black.

这篇关于在内容加载之前,我可以更改或控制IFRAME区域的颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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