Preloader background-images from CSS

basically I have a variable that main that changes it’s background image based on some triggers. The way it’s changes the background image is by adding another class for example .main .bck-1 .main .bck-2 and so on.

My question is how can I preload the background images of bck-1 bck-2 before changing it because my images it glitches on changing because the browser has to download the background-images

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.