.swf 定位不包含在页面上,在 chrome 中 [英] .swf positionning is not contained on page, in chrome

查看:31
本文介绍了.swf 定位不包含在页面上,在 chrome 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个简单页面 我正在尝试添加一个 .swf 文件,并添加了一个小的定制 js 函数向上.使用 chrome,swf 被向上推出导航器窗口,并且缺少上半部分.

This is a simple page I am trying to add a .swf to, with a small custom made js function I slapped up. With chrome the swf is pushed up and out of the navigator window and is missing the top half.

我尝试过这种快速而肮脏的方法来检测浏览器并为每个浏览器设置正确的背景值:

I have tried this quick and dirty approach to detect browser and set the proper background values for each browser:

var browser = BrowserDetect.browser;
var height = '';
var width  = '';
    switch (browser){
      case "Explorer":
        height = '800';
        width =  '1000';
        break;
      case "Chrome":
        height = '100%';
        width = '100%';
        break;
      case "Firefox":
        height = '800';
        width =  '1000';
        break;
      default:
        height = '800';
        width = '1000';
    }

上面的值设置了以下值,我可以闻到问题所在的位置:

The values from the above set the values for the following, in wich is where I can smell the problem is located:

<noscript>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="1000" height="800" id="flash28" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="/sites/all/themes/morin/bin/flash28.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /> <embed src="/sites/all/themes/morin/bin/flash28.swf" quality="high" bgcolor="#000000" width="1000" height="800"
  name="flash28" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
    </object>
</noscript>

对于嵌入标签中的电影大小:我尝试过百分比,我尝试过像素,很多不同的组合.无论我如何设置,总是 至少有一个浏览器会卡住.现在是铬窒息.有没有人知道这些参数的技巧,介意给我提供一个合适的有效方法来集成 .swf 吗?

For the movie size in the embed tag: I have tried percents, I have tried pixels, quite a few different combinations. There is always at least one browser that chokes no matter how I set it. Right now it is chrome that chokes. Does anyone knowing the trick to these parameters mind clueing me in on a proper efficient method to integrate a .swf?

也许是外部 html 代码结构不正确导致了这种情况?我不是专门的集成,我主要是后端,在网上尝试了一些解决方案,但是这个为 <nosript> 设置值的自定义 .js 是我设法接近的唯一方法跨浏览器工作.

Maybe the outer html code is not properly structured and causes this? I am not specialised integration, I am mostly a back-ender, tried a few solutions online but this custom .js that sets values for <nosript> is the only way I managed to get this close to working crossbrowser.

我的问题基本上是,集成商使用哪些干净有效的方法来集成 swf 跨浏览器,如果我设置了适当的值,我的方法是否可行?

My question basically, what are the clean efficient ways used by integrators to integrate swf cross browser, and is my approach workable if I set proper values?

感谢任何帮助/见解,谢谢.

Any help/insight appreciated, thanks SO.

推荐答案

基本上,我建议你使用 SWF 对象

Basically, I would advise you to use SWFObject

这是一个开源的 javascript 库文件,可以准确地处理您想要做的事情.

It is an open source javascript library file that will handle exactly what you are trying to do.

这也是 Flash 社区中的标准".

It also is a "standard" in the flash community.

在 google 代码页的下载列表中,还有一个方便的生成器可以帮助您处理嵌入代码.

In the downloads list on the google code page, there is a handy generator as well to help you with your embedding code.

干杯

这篇关于.swf 定位不包含在页面上,在 chrome 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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