Pentiado / angular-lazy-img

Lightweight lazy load images plugin. Only 1kb after gziping. Pure JavaScript, only Angular as dependency.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set container in directive

alexnaldo opened this issue · comments

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)

Pull requests are welcome : )

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

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

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)

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

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

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 :)

Bower registry has an old version of this module: #8

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

or

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

will work for now.

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