问题描述
打开iframe彩盒时,我得到一个白色的闪光灯。如何预先设置iframe以首先显示白色背景然后显示所谓的iframe?
I get an white flash when opening an iframe colorbox. How can I prevend the iframe to first show the white background and then the supposed iframe?
推荐答案
白色闪光是colorbox动态生成iframe。在加载iframe时,您会看到颜色框窗口本身的背景颜色。
The white flash is the result of colorbox dynamically generating the iframe. While the iframe is loading you see the background color of the colorbox window itself.
解决此问题的一种方法是使用黑色颜色框css样式,如。当您时,您可以在示例3文件夹中找到此colorbox.css文件。使用这种风格,你当然会看到一个黑色闪光而不是白色闪光,但它与彩色框叠加的半透明黑色更好地融合。
One way to solve this issue is to use the "black" colorbox css styles as demonstrated in this jsfiddle. You can find this colorbox.css file in the "Example 3" folder when you download colorbox. Using this style you will of course see a black flash rather than and white flash, but it blends in better with the translucent black of the colorbox overlay.
或者你可以自定义colorbox.css文件最适合您的需求。有5种预制样式,您可以在官方彩盒网站上看到它们。
Alternatively you can customize the colorbox.css file that's best suited to your needs. There's 5 prebuilt styles, which you can see demonstrated at the official colorbox site.
这篇关于打开iframe Colorbox时出现白色闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!