Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Windows 7 上使用 Firefox 22.0。当我加载缩放的 png 图像时,图像在加载后大约一秒钟会抖动/晃动。这是怎么回事?
<a href="bozo"> <img style="height:45px;" src="http://images.cdn.rackspace.com/header/logo-rackspace.png"> </a>
这是一个jsfiddle。我可以通过单击“运行”来重现该行为。
我在 Chrome 或 IE 上看不到这种行为。
我无法重现,但它会抖动,因为您使用 CSS 设置了大小(和错误)。
图像高度为 46 像素,首先按此加载,然后将 CSS 应用到 45 像素,将其缩小 1 像素,从而产生抖动。这个微小的差异会在屏幕上一目了然地显示出来,因为它也会影响宽度,在某些系统上可能足够明显以使其看起来抖动。
如果将图像大小设置为 46 像素,它应该会消失,或者通过将大小设置为属性:
<img height="46" ...