javascript - Apple.com 如何实现渐进式 jpeg 加载?

标签 javascript html css jpeg

如果你看看像这样的网站

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/

相关文章:

html - 如何在 VBA 网页抓取中从 HTML 代码中提取 <tspan> 元素

html - 如何使右侧栏的高度与主要内容的高度一致

javascript - 如何使用纯 JavaScript 删除特定的 <li>

javascript - typeof options == 'object' && options,为什么会返回对象值?

javascript - 如何生成5个不同的随机数?

jquery - 如何在按钮元素上显示div内容?

css - 高分辨率屏幕上的网站太小

javascript - 在 asp.net 和 javascript 中检测复选框是否被选中

javascript - 在 Data-toggle ="collapse"bootstrap 下默认打开 Navigation

php - wordpress functions.php 没有为 CSS 显示任何内容