动画 GIF 在大型 JQuery 不透明动画期间停止
此问题在两台计算机上的 IE6 和 IE8 上出现(IE6 使用 VMware),但在另一台计算机上的 IE7 上没有出现此问题。 Safari 中对于非常大的图像也存在一个问题(Safari 是相关的,尽管我并不真正关心它)
基本上当我使用 fadeTo() 或 animate({"opacity":) 在大图像中设置不透明度动画时(例如上面的400x400px) 页面上的所有 GIF 动画暂时停止。 (例如左侧的红色)
请参阅:
http://sky-walker.net/ temp/housenav/fading3.html
100x640 和 640x100 没有问题,但 400x400 图像(和 3000x3000)可能会出现问题问题是基于图像中的像素数量。
在 Firefox 和 Chrome 中,即使使用 3000x3000 的图像,gif 动画和褪色图片也非常平滑。
在 Safari 中,gif 动画和褪色图片以相同的速度和低帧速率进行动画处理(如果网页包含 3000x3000 图像)。如果页面不包含该高分辨率图像,则 400x400 图像会平滑淡出。 (转至 fading2.html)
在 IE6 和 IE 8 中,淡入淡出非常平滑,但 gif 动画会断断续续或停止。
$(document).ready(function(){
$("#fadeout1").click(function(event) {
$("#pic1").fadeTo(2000, 0.2);
});
$("#fadein1").click(function(event) {
$("#pic1").fadeTo(2000, 1.0);
});
});
<img src="the-animated-icon.gif" />
<a href="#" id="fadeout1">Fade Out</a> | <a href="#" id="fadein1">Fade In</a> <img src="the-pic-to-fade.jpg" id="pic1" />
有关更多详细信息,例如图像的确切名称,请参阅链接的源代码。
编辑: 虽然前面的链接在另一台 IE 计算机上可以正常工作,但我的原始网页却不能: http://sky-walker.net/temp/housenav2/roomsnav2old.php 当您将鼠标悬停在方形图标上时,动画 gif 就会停止。
This problem happens on IE6 and IE8 on two computers (IE6 used VMware), but not with IE7 on another computer. There is also a problem in Safari for VERY large images (Safari is related though I'm not really concerned about it)
Basically when I animate the opacity using fadeTo() or animate({"opacity":) in large images (e.g. above 400x400px) all of the animated gifs on the page temporarily stop. (e.g. the red ones on the left)
See:
http://sky-walker.net/temp/housenav/fading3.html
100x640 and 640x100 don't have the problem but the 400x400 image (and 3000x3000) does so maybe the problem is based on the number of pixels in the image.
In Firefox and Chrome the gif animation and the fading picture is very smooth, even with the 3000x3000 image.
In Safari the gif animation and fading picture animate at the same speed with a low framerate (if the webpage contains the 3000x3000 image). If the page doesn't contain that hi-res image, the 400x400 image fades smoothly. (go to fading2.html)
In IE6 and IE 8 the fading is very smooth but the gif animations stutter or stop.
$(document).ready(function(){
$("#fadeout1").click(function(event) {
$("#pic1").fadeTo(2000, 0.2);
});
$("#fadein1").click(function(event) {
$("#pic1").fadeTo(2000, 1.0);
});
});
<img src="the-animated-icon.gif" />
<a href="#" id="fadeout1">Fade Out</a> | <a href="#" id="fadein1">Fade In</a> <img src="the-pic-to-fade.jpg" id="pic1" />
See the source code of the links for more details such as the exact names of the images.
EDIT:
Though the previous link works on another IE computer with no problems, my original webpage doesn't: http://sky-walker.net/temp/housenav2/roomsnav2old.php When you hover over the square icons, the animated gif stops.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜问题很简单,就是你的CPU或显卡跟不上。渲染不透明度是一项非常密集的操作。我在一台相当强大的机器上的 IE8 中没有看到任何停止,只是稍微变慢。
I would guess the issue is simply that your CPU or graphics card cannot keep up. Rendering opacity is a very intensive operation. I see no stoppage, just a slight slowing, in IE8 on a rather beefy machine here.