Swfobject - 在 flash 之前加载替代内容
我的页面上有一个 Flash 地图。我的问题是,当页面加载一段时间后,我可以看到替代内容,然后是地图。
HTML:
<div class="flash-wrapper">
<div id="flash-map" class="flash">
<div id="noflash">
<p>
<span>Aby poprawnie wyświetlić tę stronę prosimy o zainstalowanie<br />programu Adobe Flash Player.</span>
<a class="FlashAltButton" href="http://www.adobe.com/go/getflashplayer" title="Pobierz Adobe Flash Player"><img src="/pl/img/get_flash_logo.png" alt="Pobierz Adobe Flash Player" width="158" height="39" /></a>
</p>
</div>
</div>
</div>
SWFOBJECT:
swfobject.embedSWF("http://site/flash/contest/map.swf",
"flash-map",
"410",
"365",
"9.0.0",
"http://site/flash/contest/expressInstall.swf",
flashvars,
params
);
var params = {
quality: 'high',
bgcolor: '#ffffff',
play: "true",
loop: "true",
wmode: "transparent",
scale: "showall",
menu: "true",
devicefont: "false",
salign: "",
allowFullScreen: "true",
allowScriptAccess: "sameDomain"
};
I have a Flash map on my page. My problem is that when the page loads for a while I can see the alternative content and then the map.
HTML:
<div class="flash-wrapper">
<div id="flash-map" class="flash">
<div id="noflash">
<p>
<span>Aby poprawnie wyświetlić tę stronę prosimy o zainstalowanie<br />programu Adobe Flash Player.</span>
<a class="FlashAltButton" href="http://www.adobe.com/go/getflashplayer" title="Pobierz Adobe Flash Player"><img src="/pl/img/get_flash_logo.png" alt="Pobierz Adobe Flash Player" width="158" height="39" /></a>
</p>
</div>
</div>
</div>
SWFOBJECT:
swfobject.embedSWF("http://site/flash/contest/map.swf",
"flash-map",
"410",
"365",
"9.0.0",
"http://site/flash/contest/expressInstall.swf",
flashvars,
params
);
var params = {
quality: 'high',
bgcolor: '#ffffff',
play: "true",
loop: "true",
wmode: "transparent",
scale: "showall",
menu: "true",
devicefont: "false",
salign: "",
allowFullScreen: "true",
allowScriptAccess: "sameDomain"
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您所看到的是令人讨厌的FOUC(无样式内容的 Flash)。如果您正在加载的 SWF 太重(或连接速度太慢),有时会在内容完全加载之前显示页面(这在当今的 CSS 样式表中也很常见)。
我现在能想到的唯一解决方案是将替代内容设置为“可见性:隐藏”,然后如果没有Flash,则通过Javascript使其可见。唯一的问题是,如果客户端没有 Flash 和 Javascript,他最终将没有内容......所以我很想听到不同的解决方案!
I believe that what you are seeing is an annoying FOUC (Flash of Unstyled Content). If the SWF you are loading is too heavy (or the connection too slow), sometimes happens as the pages displays before the content is totally loaded (it's quite common with CSS stylesheets too nowadays).
The only solution I can think of right now is set the alternative content to "visibility:hidden", and then if there is no Flash, make it visible by Javascript. The only problem is that if the client has no Flash and no Javascript he'll end up with no content... so I'd love to hear different solutions for this!