Image flickers because image does not load on IE and Firefox

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Image flickers because image does not load on IE and Firefox



I have this annoying problem with my code.I am building a simple page and I have an image that must change while scrolling down the page. It works perfect in Chrome, but in EDGE and Firefox on the initial scroll the image flickers when changed for the first time.
After that it is all fine. I think it is because I load the images with display:none property , so I assume they are not "downloaded properly" before actually rendered on the page.
I was wondering how I can resolve this issue?



Here is the web address



http://www.kristiyan.website



Any help will be greatly appreciated





Though not idea, you can "pre-load" the images with <img src="yourimage" style="position:relative; z-index:-1">. This way it's already loaded when you're scrolling down.
– JM-AGMS
Aug 1 at 23:34



<img src="yourimage" style="position:relative; z-index:-1">





I am already preloading them, but obviously while they are not displayed , it still flickers
– Kristiyan Kyosev
Aug 3 at 23:33





Try preloading them with z-index:-1 then z-index:1 instead of display:none.
– JM-AGMS
Aug 4 at 5:06





Thats actually a very good advice. I was doing it already but with z-index 0 and pics were stacking one under another and wasnt looking that good , but the -1 will do the job.Thanks a lot man
– Kristiyan Kyosev
Aug 5 at 0:40


s actually a very good advice. I was doing it already but with z-index 0 and pics were stacking one under another and wasn









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard