Firefox 和 IE9 下的 Flash 网站错误(但适用于 IE6!)
我的网站无法在 firefox(firefox 4 或 7)上运行,什么也没有出现,甚至没有替代内容
,而对于 IE9,问题是内容被压缩在页面顶部...(但它可以在 IE6 上运行!)
html 是 :
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<script type="text/javascript" src="jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="jq.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myId", "9.0.115", "expressInstall.swf");
</script>
</head>
<body>
<div id="flash">
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">
<param name="movie" value="ombre.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="ombre.swf" width="100%" height="100%">
<!--<![endif]-->
<p>alternative content</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</head>
</html>
css :
body {
width:100%; height:100%; margin:0; background:white; overflow:hidden;
}
这似乎是“高度”设置为 100% 的问题,但我还能放什么?该网站适用于 chrome、safari、ie6...
谢谢
my website does not work on firefox (firefox 4 or 7), nothing appears, even not the alternative content
and with IE9, the problem is the content is compacted at the top of the page... (but it works on IE6 !)
and the html is :
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<script type="text/javascript" src="jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="jq.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myId", "9.0.115", "expressInstall.swf");
</script>
</head>
<body>
<div id="flash">
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">
<param name="movie" value="ombre.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="ombre.swf" width="100%" height="100%">
<!--<![endif]-->
<p>alternative content</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</head>
</html>
and the css :
body {
width:100%; height:100%; margin:0; background:white; overflow:hidden;
}
it seems to be a problem with the "height" set to 100% but what else can i put? the website works on chrome, safari, ie6...
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
既然您正在使用 swfObject 为什么不使用它来进行实际的嵌入
您会发现以下代码示例更加符合浏览器要求。
[编辑]
试试这个
Since you are using swfObject why are you not using it to do your actual embedding
You will find the following code example to be much more browser compliant.
[EDIT]
Try this out
我最近也遇到了同样的问题,我将高度和宽度设置为100%,而firefox不会显示IE9会将swf压缩到页面顶部高度:100px之类的。我用 JavaScript 修复了这个问题,实际上是 jQuery(只是因为它可用):
本质上 FF 在调整大小时不喜欢 % 值,而 IE9 有一个不同的问题。如果您添加静态值,就不会有问题。但我们不想要静态值,不是吗?
不管怎样,我通过告诉 JavaScript 为我编写 Flash 标签并根据屏幕尺寸插入静态值解决了我的问题。
我使用
$(window).width()
获取屏幕的宽度,然后使用Math.round(($(window).width()*11)/24)
code> 因为我的电影的比例是 24X11。这又是我的 jQ 解决方案,因为它可用,您可以使用 screen.width 来获取它。您可能必须将所有内容压缩为一行,尽管我只是将其间隔开,以便您可以看到发生了什么。
I had this same problem recently, I had set the height and width to 100% and firefox would not display IE9 would squish the swf to the top of the page height:100px or something. I fixed it with JavaScript, actually jQuery (simply because it was available):
Essentially FF doesn't like % values when you size things, and IE9 has a different problem. If you added static values you wouldn't have a problem. But we don't want static values do we?
Anyways, I solved my issue by telling the JavaScript to write the Flash tag for me and insert static values based on the screen size.
I used
$(window).width()
to get the width of the screen and thenMath.round(($(window).width()*11)/24)
because the proportions of my movie were 24X11.Again this was my jQ solution because it was available, you could use screen.width to get it. You might have to condense everything to one line though I just spaced it so you could see what's going on.