我正在为国家公园服务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">');
示例图片:
目前如何显示图像: