-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preferred method of avoiding FOUC #590
Comments
I settled on
which seemed to work for my needs. |
With current version you can do this: .lazyload {
opacity: 0.0001;
} With next version you will be able to do this: .lazyload {
visibility: hidden;
} Because then I will handle |
@aFarkas Thanks for the reply. Is there a particular reason that opacity: 0.0001 is needed? In the code, I see special conditions for display: none and visibility: hidden, but nothing for opacity: 0, so I was just curious. |
Well, if you are using it only on |
Hi @aFarkas from another (totally unrelated, as far as I know) AFarkas! I've applied
Not sure why this is needed but thought I'd drop it here. |
I know it's been a long time since you asked the question but if you are still interested in the response, It's llinked to the fact that transitionning to opacity 0 triggers a repaint of the component while opacity 0.001 does not ! |
Hello,
I used to use
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
in my tags. I did this to avoidalt="some alt text"
FOUC when initially loading the page. However, given issues like the following:#509
(the above link references to the below 2 links, in another library)
verlok/vanilla-lazyload#212
https://github.com/verlok/lazyload#do-not-use-placeholder-images
I have stopped doing using the transparent pixel method. I noticed that you are also removing some of these same things in some of your latest commits. I also had an unusual condition that came about because of the use of the 1x1 pixel being used in place of another image that had a different ratio cause some DOM layout issues until the image became
lazyloaded
.However, the result is that I now sometimes have the flash of alt text before my images begin loading. What is the preferred method of avoiding this? Currently, the only other solution I have is to stop using
alt=""
attribute completely. If I add.lazyload{ visibility: hidden; }
, this negatively affects image rendering time on initial load as it places the images further down the priority chain. If I useclass="lazypreload"
, then it loads all my images, even ones that I don't want to load yet. So, I'm not sure of the best solution?The text was updated successfully, but these errors were encountered: