Optimize javascript pre-load of images

后端 未结 5 2192
無奈伤痛
無奈伤痛 2021-02-09 20:19

I was wondering if anyone has any strategies for optimizing the pre-loading of images via javascript?

I\'m porting a Flash application into html/css, attempting to recre

5条回答
  •  执念已碎
    2021-02-09 20:37

    I would say using CSS sprites is a big one. Having all your images, or images of a similar nature come down on the one HTTP request really helps load time. Downloading 10 images with a total file size of 100kb is going to be slower than downloading 1 image the same size. It also helps images come down before they are required in the case of hovers and mouse over events and they generally make things a lot smoother.

    Here is an article on them.

提交回复
热议问题