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

查看:172
本文介绍了.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>

对于嵌入式标签中的电影大小:我尝试过百分比,我尝试了像素,相当几种不同的组合。至少有一个浏览器无论我如何设置都会阻止始终。现在是cho is的铬。有没有人知道这些参数的诀窍,让我知道一个合适的有效方法来整合.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代码没有正确的结构,导致这个?我不是专门的集成,我主要是一个后盾,在线尝试了一些解决方案,但是这个定制的.js设置< nosript> 的值是我唯一的方法

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?

谢谢SO。

推荐答案

基本上,我建议您使用 SWFObject

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.

它也是一个标准闪光社区。

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天全站免登陆