JS: Pre-Cache Images
How to pre-cache Images?
Like this:
(new Image()).src = "cats.png";
The Image
is a constructor that returns a HTMLImageElement
object, which represents the image element.
How to pre-cache Images?
Like this:
(new Image()).src = "cats.png";
The Image
is a constructor that returns a HTMLImageElement
object, which represents the image element.