如果你看看像这样的网站
http://www.apple.com/watch/overview/
您会看到他们的 .jpg 以非常规方式加载,从像素化版本开始并慢慢增加分辨率,而不是从上到下加载。
在 inspector 中,图像对我来说没有什么特别之处。这是对文件本身进行索引以便浏览器按此特定顺序接收数据的某种方式吗?
最佳答案
这听起来像是一种 Progressive Jpeg 格式,根据维基百科:
There is also an interlaced "Progressive JPEG" format, in which data is compressed in multiple passes of progressively higher detail. This is ideal for large images that will be displayed while downloading over a slow connection, allowing a reasonable preview after receiving only a portion of the data. However, support for progressive JPEGs is not universal. When progressive JPEGs are received by programs that do not support them (such as versions of Internet Explorer before Windows 7)[13] the software displays the image only after it has been completely downloaded.
这与 Javascript、HTML 或 CSS 无关,而更多是所用文件类型的产物。
关于javascript - Apple.com 如何实现渐进式 jpeg 加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28788748/