I am running a very simple slide show that changes the background of a div after some time. The problem is that the images are loaded too slow and a blank screen appears between image changes. Now I want to preload the images and I found these answers, but they did not work, and:
var myImage = new Image();
myImage.src = 'picture.jpg';
Can I somehow use this myImage
as background-image of a div? Or do you know any other methods for preloading background-images?
Using :after
pseudo-elements did not work.