使用 swfobject & 显示大量 HTML 替代内容swffit 闪存站点

发布于 2024-08-14 08:17:15 字数 301 浏览 4 评论 0原文

我有一个完整的 Flash 站点,它使用 swfobject 将其嵌入 100% 高度和宽度。我使用 swffit 强制浏览器滚动条显示包含大量内容的页面。这一切都很好并且工作完美。 除了为了让 flash swfobject 工作之外,我需要在 CSS 中添加溢出 = 隐藏,例如:

html{
height: 100%;
overflow:hidden; 
}
#content{
height: 100%;
}

我还有 HTML 格式的内容,作为替代内容,这也可以工作, 显示替代内容。 有谁知道如何解决这个问题?

I have a full flash site which uses swfobject to embed it 100% height and width. I'm using swffit to force a browser scroll bar for pages with a large amount of content. This is all fine and works perfectly. I also have the content in HTML format, as alternative content and this also works apart from in order to get the flash swfobject to work I need to add the overflow = hidden in the CSS, like:

html{
height: 100%;
overflow:hidden; 
}
#content{
height: 100%;
}

This then stops the scroll bar showing when the alternative content is shown.
Does anyone know how to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一花一树开 2024-08-21 08:17:15

我不知道 SWFFit,但为什么首先需要 overflow:hidden ?没有的话就不行吗?

想到的唯一解决方法是定义两个类,一个带有 overflow:hidden ,一个不带有 overflow:hidden ,并通过触发从 Flash 中以编程方式更改 html 元素的类一些 JavaScript。

I don't know SWFFit but why do you need the overflow: hidden in the first place? Won't it work without?

The only workaround that comes to mind is to define two classes, one with, one without overflow: hidden, and change the class of the html element programmatically from within Flash by triggering some Javascript.

微暖i 2024-08-21 08:17:15

如果您需要根据 SWFObject 嵌入的成功来更改页面的 CSS 或内容,请使用 SWFObject 2.2 中的回调函数功能。

对于动态发布,它看起来像这样:

var flashvars = {};
var params = {};
var attributes = {};
var embedHandler = function (e){
};

swfobject.embedSWF("mymovie.swf", "targetID", "550", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes, embedHandler);

在您的情况下,如果您需要从 HTML 元素中删除 Overflow:hidden,您可以执行以下操作:

var flashvars = {};
var params = {};
var attributes = {};
var embedHandler = function (e){
   //If embed fails
   if(!e.success){
      document.getElementsByTagName("html")[0].style.overflow = "auto";
   }
};

swfobject.embedSWF("mymovie.swf", "targetID", "550", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes, embedHandler);

此回调函数功能仅在 SWFObject 2.2 中可用。

If you need to change a page's CSS or content based on the success of a SWFObject embed, use the callback function feature in SWFObject 2.2.

For dynamic publishing, it looks like this:

var flashvars = {};
var params = {};
var attributes = {};
var embedHandler = function (e){
};

swfobject.embedSWF("mymovie.swf", "targetID", "550", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes, embedHandler);

In your situation, if you needed to remove overflow:hidden from the HTML element, you could do this:

var flashvars = {};
var params = {};
var attributes = {};
var embedHandler = function (e){
   //If embed fails
   if(!e.success){
      document.getElementsByTagName("html")[0].style.overflow = "auto";
   }
};

swfobject.embedSWF("mymovie.swf", "targetID", "550", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes, embedHandler);

This callback function feature is only available in SWFObject 2.2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文