Flash网站与Firefox和IE9的错误(但在IE6上工作!) [英] flash website bug with firefox and IE9 (but works on IE6 !)

查看:150
本文介绍了Flash网站与Firefox和IE9的错误(但在IE6上工作!)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站在firefox(firefox 4或7)上无法正常工作,什么也没有出现,甚至没有替代的内容和IE9,问题是内容是压缩在页面的顶部...(但它适用于IE6!)



和html是:

 <!DOCTYPE html> 
< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = UTF-8>
< title>< / title>

< link rel =stylesheettype =text / cssmedia =allhref =style.css/>
< script type =text / javascriptsrc =jquery-1.5.1.min.js>< / script>
< script type =text / javascriptsrc =jq.js>< / script>
< script type =text / javascriptsrc =swfobject.js>< / script>
< script type =text / javascript>
swfobject.registerObject(myId,9.0.115,expressInstall.swf);
< / script>
< / head>
< body>

< div id =flash>

< object id =myIdclassid =clsid:D27CDB6E-AE6D-11cf-96B8-444553540000width =100%height =100%>
< param name =movievalue =ombre.swf/>
<! - [if!IE]> - >
< object type =application / x-shockwave-flashdata =ombre.swfwidth =100%height =100%>
<! - <![endif] - >
< p>替代内容< / p>
<! - [if!IE]> - >
< / object>
<! - <![endif] - >
< / object>

< / div>

< / body>
< / head>
< / html>

和css:

  body {
width:100%;高度:100%;余量:0;背景:白色;溢出:隐藏;

$ / code>

这似乎是高度设置为100%的问题,但我还能放什么?该网站的作品在铬,Safari浏览器,ie6 ... $ / b>
$ b

感谢

解决方案

由于您使用的是swfObject,为什么不使用它来做实际的嵌入呢?
您会发现下面的代码示例更符合浏览器的要求。

 < script type =text / javascriptsrc =swfobject.js>< / script> 
< script type =text / javascript>
函数loaded(){
var flashvars = {},params = {},attributes = {},tmp,version,width,height,container,flashObj;

flashvars.UserId =23061;

params.menu =true;
params.quality =high;
params.bgcolor =#869ca7;
params.allowscriptaccess =always;
params.allownetworking =all;

attributes.id =myId;
attributes.name =myId;
attributes.align =middle;
attributes.allowscriptaccess =always;
attributes.allownetworking =all;

tmp =expressInstall.swf;
version =9.0.115;
width =100%;
height =100%;
container =replaceMe;
flashObj =myId.swf;

swfobject.embedSWF(flashObj,container,width,height,version,tmp,flashvars,params,attributes);
}

< / script>

< body onLoad =loaded()>
< div id =replaceMe>加载内容。< / div>
< / body>



试试这个

 < style> 
html,body {
width:100%;
身高:100%;
保证金:0;
背景:白色;
overflow:hidden;
}
< / style>


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

解决方案

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.

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
  function loaded() {
    var flashvars={}, params={}, attributes={}, tmp, version, width, height, container, flashObj;

    flashvars.UserId = "23061";

    params.menu = "true";
    params.quality = "high";
    params.bgcolor = "#869ca7";
    params.allowscriptaccess = "always";
    params.allownetworking = "all";

    attributes.id = "myId";
    attributes.name = "myId";
    attributes.align = "middle";
    attributes.allowscriptaccess = "always";
    attributes.allownetworking = "all";

    tmp = "expressInstall.swf";
    version = "9.0.115";
    width = "100%";
    height = "100%";
    container = "replaceMe";
    flashObj = "myId.swf";

    swfobject.embedSWF(flashObj, container, width, height, version, tmp, flashvars, params, attributes);
  }

</script>

  <body onLoad="loaded()" >
    <div id="replaceMe">Loading content.</div>
  </body>

[EDIT]
Try this out

<style>
html, body{
  width:100%;
  height:100%;
  margin:0;
  background:white;
  overflow:hidden;
}
</style>

这篇关于Flash网站与Firefox和IE9的错误(但在IE6上工作!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆