S
S
Sergey Nikolaev2019-06-27 06:09:14
JavaScript
Sergey Nikolaev, 2019-06-27 06:09:14

Firefox Mozilla not taking images from cache when substituting via javascript?

When you hover over a page element, a background image is substituted via javascript. Substitution takes place exactly different images, for the possibility of the effect of their smooth change ( transition: background 0.3s linear). For Firefox, I also tried with a prefix, but in the latest version (67.0.4) this CSS property should be supported anyway.
Here's how I do it in JS:

htmlElement.style = "background: url('/img/mainpage/img01.png') center top no-repeat";

The bottom line is that browsers Chrome, Opera, Age, after saving images to the cache, then take them from it, but Firefox, with each substitution, turns to the server for images. Because of this, images twitch when changing. Why doesn't Firefox take them from the cache if it saves them there?
Perhaps this is due precisely to the fact that they are substituted through javascript. Then tell me in which direction to move to solve this problem.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question