前端外部图像压缩

时间:2018-05-15 04:27:40

标签: javascript html compression

我正在为国家公园服务API显示网络应用程序的图像,缩略图中显示的图像会导致很多延迟。

有没有办法在显示之前压缩图片网址或以某种方式减少延迟?

以下代码是图像的显示方式。

for (let j = 0; j < parkInfo.data[i].images.length; j++) {
  $('#pics').append('<img src="' + parkInfo.data[i].images[j].url +
    '" width="33%" altText="' + parkInfo.data[i].images[j].altText +
    '" class="img-thumbnail">');

示例图片: enter image description here

目前如何显示图像: enter image description here

0 个答案:

没有答案