-
Notifications
You must be signed in to change notification settings - Fork 142
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
How can I manually trigger the loading of images? #197
Comments
Hi @philipgiuliani, The problem is that So in order to solve your use case we need to let
// In your component
constructor() {
this.updateSearchResult$ = new Subject();
this.scrollAndSearch$ = Observable.merge(
Observable.fromEvent(window, 'scroll')
this.updateSearchResult$
);
}
onSerachResultResponse() {
this.updateSearchResult$.next()
} // in your template
<img [lazyLoad]="lazyLoadImage" [customObservable]="scrollAndSearch$" /> Did this answer your question? |
I was searching for a solution to a similar problem, and want to share it, because I suspect this issue is where people will probably find it. Problem: load images after a delay, even if they are not visible within the offset
|
Thanks for your contribution, I added a link to this issue in the readme file. |
当我快速滚动容器后,滚动过去的图像不加载,滚动结束后,加载当前视口的图片,怎么做?? |
@pangshangggg, sorry but I don't understand. I tried to use google translate but I did not understand your question :/ is it possible for you to write in English? |
In Ionic 2/3, the images don't load until the user start scrolling. You can solve this in two ways:
And this is the good way :
I just transposed the solutions posted above to ionic. Nothing more :) |
In Angular 6 and rxjs 6, I'm trying to trigger manually the lazy load by scroll event by following the previous examples but it's not working. All the images are loading one after another without scrolling the page. This is my code. Template:
component: I followed this example from issue 224 where el-Davo said that this fixes the problem in Angular 5 |
sorry but i have a problem. |
Hi @zarinara, |
Hi |
@zarinara, can you create a new issue and include some code examples and the version number of |
I am using ng-lazyload-image in a filterable collection. It works fine when scrolling, but when I filter the list, the thumbnails are not appearing. Thats happening because no scroll event is fired. After scrolling a bit they appear.
Demo
Workaround
I found a hacky workaround, but I'm not happy with it…
The text was updated successfully, but these errors were encountered: