Pentiado / angular-lazy-img

Lightweight lazy load images plugin. Only 1kb after gziping. Pure JavaScript, only Angular as dependency.
MIT License
178 stars 66 forks source link

Using a scrollable container generated dynamically by controller #16

Closed jup31 closed 8 years ago

jup31 commented 8 years ago

Hello everybody,

I face an issue to work with the scrollable container as my container is generated using ng-view, it doesn't exist during the configuration step. Do you have any idea how I can solve this issue or is it dependent to the library ?

I had added a question on stackoverflow regarding this : Stack question linked

Thanks in advance, Julien

jup31 commented 8 years ago

Soory I hadn't seen issue 4, I will test it.

Pentiado commented 8 years ago

Thanks for Pull Request!

jup31 commented 8 years ago

No problem even if it doesn't solve fully my issue, the scrollable container is now good. The only issue is when scrolling quick the images aren't loaded. Did you know why it is not working ? I have look for scroll and touchMove event implemented in the code but I don't understand why image are only loaded if i scroll really slow and not fast.

Pentiado commented 8 years ago

https://github.com/Pentiado/angular-lazy-img/blob/master/src/angular-lazy-img-logic.js#L45 Function that checks images is wrapped in throttle for performance reasons. Maybe it's the culprit in your case?

I don't have time now to dive deep into this issue. Building start-up isn't an easy job. If you find the solution for your problem, feel free to send another pull request.