缓存imgs的数组并在使用其中一些之后[重复](Caching array of imgs and after using some of them [duplicate])

编程入门 行业动态 更新时间:2024-10-28 04:28:18
缓存imgs的数组并在使用其中一些之后[重复](Caching array of imgs and after using some of them [duplicate])

这个问题在这里已有答案:

如何在Javascript 8答案中 缓存图像

有没有办法在加载时缓存图像,并在需要时从缓存中使用它们。

我正在使用jquery。

This question already has an answer here:

How do you cache an image in Javascript 8 answers

Is there any way to cache images on load and use them from cache when they are needed.

I am using jquery.

最满意答案

你可以用这样的javascript缓存(或预加载)一个图像:

<script> img1= new Image(); img1.src="yourimagefile.jpg"; </script>

you can cache (or pre-load) an image with javascript like this:

<script> img1= new Image(); img1.src="yourimagefile.jpg"; </script>

更多推荐

本文发布于:2023-07-20 02:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1191454.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:并在   数组   缓存   imgs   duplicate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!