Is it possible to insert images in cache before rendering

前端 未结 3 451
傲寒
傲寒 2020-12-19 22:06

I have this webpage which shows me some images and some images are on a mouseover event and hence it takes time for them to display. I have worked it around by placing the m

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-19 22:34

    You can just use (new Image).src="http://path/to/img.jpg" which will make the browser load it

提交回复
热议问题