dongshenghe1833 2010-08-12 14:11
浏览 52

对象标签自动隐藏,为什么?

I am trying to place flash swf into my html through php but when the page loads the flash file is hidden. I can hear the sounds and music but it is not visible.

Here is the code I am using:

'<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
                <script type="text/javascript">
        swfobject.registerObject("game", "10.0.0");
                </script>
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'.$gameWidth.'" height="'.$gameHeight.'" id="game">
            <param name="movie" value="'.__BASE_URL.'games/'.$gameFile.'" />
                            <param name="wmode" value="transparent" />
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="'.__BASE_URL.'games/'.$gameFile.'" width="'.$gameWidth.'" height="'.$gameHeight.'">
                                <param name="wmode" value="transparent" />
            <!--<![endif]-->
                <a href="http://www.adobe.com/go/getflashplayer">
                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                </a>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object><br/>'

Here is the styles I am using on it:

 #game{
      background-color: #fff;
 }

When I load it and check the source this is added:

element.style {
     visibility:hidden;
}
#game {
     visibility:hidden;
}

How do I prevent this?

  • 写回答

1条回答 默认 最新

  • douba6365 2010-08-12 15:01
    关注

    I figured it out, the problem was with the swfObject. For some reason it was hiding the file so I added this line to my javascript file:swfobject.switchOffAutoHideShow();, this seems to fix the problem. I still don't know why it was doing it in the first place though.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大