Image flickers because image does not load on IE and Firefox
Clash 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
<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
That
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
t 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.
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