-
Notifications
You must be signed in to change notification settings - Fork 143
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
default Image is not visible #44
Comments
Hi, The example page was using the following css style: img {
opacity: 0;
}
img.ng2-lazyloaded {
opacity: 1;
} eg, it was intended to hide the image (and the default image) until the lazy-loaded image was loaded. However, if you remove I have updated the example page with some more examples. Go to http://tjoskar.github.io/ng2-lazyload-image/ and click on "Default image" to see an example of using default images. Did I answer your question? |
You have example code here: https://github.com/tjoskar/ng2-lazyload-image/blob/master/example/default-image.component.ts |
@tjoskar I have tried everything, still not working, the default image doesn't show up at all, and the path is correct because if i replaced the lazyloder image with the default image and the default image loads, the issue is when i checked google chrome inspector tool, i see that there is no where the default image was attached to the src attribute of the image, instead the lazyloader image is attached by default. Please is there any other way around this? Waiting for your response. Thanks |
@kelvinrolex, I'm not sure that I follow. If the image that should be lazyloaded is already in the browser cache, the default image will never be visible. The algorithm follows:
I recorded a video to show how the default image is loaded: https://www.youtube.com/watch?v=p4hds8Au_qI Do you have a code snippet that you can share so I can get a better understanding of what you are trying to do. Thanks |
Looks like I have the same problem. If I use [src]="defaultImage" (and, of course have a defaultImage property), the src attribute of the img tag is not written before the image is loaded (comes into view port). If I use no property binding (e.g.: <img src="foo.png" ..>), than the default image is loaded and replaced as expected. |
@taseroth, Sorry for the late reply. What browser and OS are you using? I can not reproduce this in Chrome/Firefox/Safari on macOS. |
I have the same issue. Default image is nod rendered (Only if I put it explicitly with "src" & hardcoded placeholder url). |
@bsh314, I do not follow.
You should use
Are you referencing to bootstraps scrollspy? Can you reproduce the error without scrollspy? |
@tjoskar No, i'm not 8using bootstrap, that was only the way to name that type of functionality. |
I have the same problem. It only works if the img url is hard-coded in the template.
Edit: And maybe it also works if AOT can hard-code the url into the template for you. In my case I get default image url from my previous API call, so it is dynamic. My goal is to use default image as low quality preview and lazy-load higher quality image to replace it. |
1. We do not use it 2. It cause some bugs
@tjoskar Problem seems to be fixed in 2.3.2. Thank you so much for your work! :) |
I'm going to close this now. Please let me know of any of you still have the issue. |
I have added the default Image as well the lazyload image path .
Did not get anything visible until the lazyload Image loaded.
Same as on the example
The text was updated successfully, but these errors were encountered: