I am using a flash slideshow on a page that takes a little while to load - and while it is loading it looks like nothing is there as the div holding the flash element has a transparent background.
我在一个需要一段时间加载的页面上使用Flash幻灯片放映 - 当它加载时,看起来没有任何东西,因为持有flash元素的div具有透明背景。
How can I show a loading icon while flash is loading - and then hide it once the flash starts?
如何在加载闪光灯时显示加载图标 - 然后在闪光灯启动后隐藏它?
I am using jquery in my page head for other pages on the site so something based in jquery would be awesome.
我在我的页面头部使用jquery用于网站上的其他页面,所以基于jquery的东西会很棒。
I am a css'er so please excuse my javascript ignorance!
我是一个css'er所以请原谅我的javascript无知!
Thanks in advance.
提前致谢。
2 个解决方案
#1
I am assuming that you have an HTML page that has a Flash element (your slideshow) being loading in.
我假设您有一个HTML页面,其中正在加载Flash元素(幻灯片)。
You could just cheat and put a loading graphic "behind" the flash element. It will show up when the HTML page loads, but when the Flash loads over the top, the loading graphic will be obscured from view.
你可以欺骗并将一个加载图形放在flash元素的“后面”。它将在加载HTML页面时显示,但是当Flash加载到顶部时,加载图形将从视图中隐藏。
Or if you have access to the Flash Slideshow source, you could make an external interface call to a javascript function that hides the loading graphic. To hide the element, just set its CSS "display" attribute to "none".
或者,如果您可以访问Flash幻灯片源,则可以对隐藏加载图形的javascript函数进行外部接口调用。要隐藏元素,只需将其CSS“display”属性设置为“none”即可。
#1
I am assuming that you have an HTML page that has a Flash element (your slideshow) being loading in.
我假设您有一个HTML页面,其中正在加载Flash元素(幻灯片)。
You could just cheat and put a loading graphic "behind" the flash element. It will show up when the HTML page loads, but when the Flash loads over the top, the loading graphic will be obscured from view.
你可以欺骗并将一个加载图形放在flash元素的“后面”。它将在加载HTML页面时显示,但是当Flash加载到顶部时,加载图形将从视图中隐藏。
Or if you have access to the Flash Slideshow source, you could make an external interface call to a javascript function that hides the loading graphic. To hide the element, just set its CSS "display" attribute to "none".
或者,如果您可以访问Flash幻灯片源,则可以对隐藏加载图形的javascript函数进行外部接口调用。要隐藏元素,只需将其CSS“display”属性设置为“none”即可。
#2
Use a preloader
使用预加载器