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

Set container in directive #4

Closed alexnaldo closed 9 years ago

alexnaldo commented 9 years ago

If I have an image in a second page your code doesn't work because locates for 'window' or 'container' in the main page.

... in config code...

scrollable = document.querySelector('#scrollable') container: angular.element(scrollable)

Pentiado commented 9 years ago

Pull requests are welcome : )

Jurigag commented 9 years ago

+1 Anyone have solution ? Also im not sure but there is this container but in JS is nowhere used :P

Pentiado commented 9 years ago

Tomorrow I start my vacation, then I'll jump into this issue : )

Pentiado commented 9 years ago

I added a directive "lazyImgContainer" which when added to some element as attribute will trigger on scroll "checkImages" the same way as window (or container if set in provider)

Jurigag commented 9 years ago

Nice, i will test it tomorrow and provide some info :D

Jurigag commented 9 years ago

How is it working exactly ? I have div with style like and added directive lazy-img-container:

overflow-y:scroll height:400px

and in there ng-repeat with div where inside are images, but its not working

rictorres commented 9 years ago

Doesn't work for me either. Tried passing container inside the options object and also attaching lazy-img-container to the scrollable element.

I think this should be reopened :)

rictorres commented 9 years ago

Bower registry has an old version of this module: https://github.com/Pentiado/angular-lazy-img/issues/8

bower install --save angular-lazy-img#fa48333273f9e

or

bower install --save angular-lazy-img#master

will work for now.

Pentiado commented 9 years ago

Yes, sorry guys I forgot about publishing tag. Now it should be working.