仅在 Firefox 中首次单击任何链接时 Flash 重新加载(默认阻止)

发布于 2024-10-01 13:47:27 字数 806 浏览 6 评论 0原文

我一直在关注类似问题的几个答案,但一点运气都没有,所以我决定尝试自己问:

我有一个页面,其中有几个链接,必须使用 jquery 通过 Ajax 加载数据并将响应放入 div 中。主要的“选项卡”是一个位于图层内部的闪存。每次用户单击任何这些链接时,Flash 容器的大小都会调整为 0px 并将可见性设置为隐藏(如果显示设置为无,则尝试阻止重新加载行为)。

一切正常,除非您第一次单击任何隐藏 Flash 层的链接。在这种特殊情况下(仅在 Firefox 中),它将闪存重置为初始状态。我对此感到疯狂......

这就是我所做的,恢复:

1. when user clicks to link 
     -> visibility: hidden, height: 0px (to the SWF container)
     -> ajax call to load content, innerHTML native JS to put this content and
     -> .css('display', 'block') to content container
2. when user clicks to main link
     -> clear content container with .htm('')
     -> hide content container with .css('display','none')
     -> visibility: visible; height: 500px; to SWF Container

任何提示和/或解决方案将不胜感激!

提前致谢

I'd been following several answers to similar problems with no luck at all, so i decided to try asking by myself:

I have a page with several links that have to load data via Ajax using jquery and put the response inside a div. The main "tab" is a flash wich is inside a layer. Every time a user clicks on any of those links, flash container is resized to 0px and set visibility to hidden (trying to prevent the reload behaviour if display is set to none).

All works just fine EXCEPT the first time you click on any link that hides flash layer. In that particular case (only in Firefox) it resets the flash to initial state. I'm going nuts about this...

here is what i do, resumed:

1. when user clicks to link 
     -> visibility: hidden, height: 0px (to the SWF container)
     -> ajax call to load content, innerHTML native JS to put this content and
     -> .css('display', 'block') to content container
2. when user clicks to main link
     -> clear content container with .htm('')
     -> hide content container with .css('display','none')
     -> visibility: visible; height: 500px; to SWF Container

Any hints and/or solutions will be GREATLY appreciated!

Thanks in advance

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

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

发布评论

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

评论(1

信愁 2024-10-08 13:47:27

好的,我找到了解决方法

看来问题与链接无关。这似乎是关于第一次调整大小。所以我发现,如果我在静态 css 文件中将 div 的高度设置为 0,并且当我加载游戏时,我通过 javascript 更改它,则在后续调整大小时不会重新加载。

希望这对任何人都有帮助。

Okay, i found a workaround

It seems that the problem isn't about links. It seems to be about the first resize. So i found that if i set the height of the div to 0 in my static css file, and when i load the game i change it via javascript, no realoads are done in subsequent resizes.

Hope this helps to anybody.

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