在 Firefox 中请求页面后显示 GIF 动画
我有一个简单的 throbber,当 ajax 请求持续超过 3 秒时会自动显示。该 throbber 主要由动画 GIF 图像组成。
现在,我想对常规链接也使用相同的 throbber,这意味着当我单击链接并且服务器需要超过 3 秒的时间来响应时,会显示 throbber。
不幸的是,Firefox 在“重新加载”网页时似乎无法播放动画。 javascript 被调用并使 throbber 正确淡入,但它不旋转。
如何让 Firefox 在加载时播放 GIF 动画?
I have a simple throbber, that is automatically shown when an ajax request lasts longer than 3 seconds. This throbber consists mainly of an animated GIF-Image.
Now, I want to use the same throbber also for regular links, meaning that when I click a link and it takes the server more than 3 seconds to respond, the throbber is shown.
Unfortunately, it seems that firefox is unable to play the animation, while it is "reloading" the webpage. The javascript is called and fades the throbber correctly in, but is it not spinning.
How can I make firefox play the GIF-Animation while it is loading?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是函数:
如果您使用 jQuery:
在调用所有 Ajax 内容之前检查 DOM 何时准备就绪。
使用原型:
使用 jQuery:
或参考此:http://plugins.jquery.com/project/throbber
This is the function:
If you use jQuery:
Check to see when the DOM is ready before calling all your Ajax stuff.
using Prototype:
using jQuery:
Or Refer this: http://plugins.jquery.com/project/throbber
我刚刚尝试了我的旧代码,发现这个问题在 Firefox 10.0.2 中不再存在
I just tried my old code and found out that this issue does not exist anymore in Firefox 10.0.2