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
load images that appear on viewport #381
Comments
That sound weird. What version of |
I have the same issue on Chrome, Firefox and Edge. I'm using [hidden] (true by default) on component that have lazy loaded images. My img tag in component: <img [lazyLoad]="recipe.image"
[offset]="100"
src="ng-assets/animations/recipe-loader.gif"> And my component: <app-recipe *ngFor="let recipe of recipes; let i = index;"
[hidden]="activeRecipeIndex !== i"
[recipe]="recipe">
</app-recipe> |
Hi @zieka, The problem is that the image is hidden when There is however three ways of solving this.
import { LazyLoadImageModule, intersectionObserverPreset } from 'ng-lazyload-image';
...
LazyLoadImageModule.forRoot({
preset: intersectionObserverPreset
})
...
|
hello, @tjoskar i kind of solved this problem by using |
Thanks @tjoskar it works :) I choose first option :) |
when page loaded, the default images doesnt change to lazyload ones on viewport, only when scroll starts the images are appearing, how can i handle the images that are on the viewport? thanks
The text was updated successfully, but these errors were encountered: