我有 flash,加载需要一些时间。我想通知用户它正在加载,他们应该等待。我在想的是我可以将文本放在 Flash 内容下,当加载 Flash 内容时,文本将被内容隐藏。这是我到目前为止所拥有的:
<object id="call-widget" type="application/x-shockwave-flash" data="https://clients4.google.com/voice/embed/webCallButton" width="230" height="85">
<param name="movie" value="https://clients4.google.com/voice/embed/webCallButton" />
<param name="wmode" value="transparent" />
<param name="FlashVars" value="id=a8dd9c58da5043dca0e879988f5cadc447e74f7a&style=0" />
</object>
<span style="z-index:-1;">Google Voice is loading...</span>
这会将文本“Google Voice is loading...”放在 Flash 内容的旁边,而不是后面。如果我输入 position:fixed
就可以了或 position:absolute
但是我在 TINYBox2 中有这个 html并通过将位置设置为固定,它会将内容从 TINY 框中偏移出来(看起来不自然)。有什么办法可以把<span>
在 TINYBox2 的中心并在 Flash 内容的后面?
注意:我无法控制闪光灯(它由 Google Voice 提供)
TINYBox2 代码如下:
TINY.box.show({html: theHtmlYouSeeAbove});
它应该是这样的:
只有在加载时才能看到 Flash 内容后面的文本。
最佳答案
因为你使用的是 TinyBox,所以将它应用到 tinner 类
.tinner {
position:relative;
}
现在您可以让您的 span 具有绝对位置,并给出相对于其所在的 div 的顶部/左侧/右侧/底部位置(.tinner 假设为 TinyBox)。 不要担心 z-index,因为 flash 文件肯定会在它上面。
关于javascript - 如何在文本上定位闪光,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15260953/