Skip to content
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

Doesn't seem to work with angular #7

Open
coomsie opened this issue Mar 6, 2014 · 7 comments
Open

Doesn't seem to work with angular #7

coomsie opened this issue Mar 6, 2014 · 7 comments

Comments

@coomsie
Copy link

coomsie commented Mar 6, 2014

No description provided.

@ericandrewlewis
Copy link

Or, doesn't work with dynamically injected image elements.

@vvo
Copy link

vvo commented Jun 6, 2014

dynamically injected image elements are already non-blocking images and so there's no need to lazyload them.

But if you still want to lazyload them you can call lzld(element) manually when you are inserting them.

See this discussion: vvo#42

@neptunian
Copy link

@vvo There are some use cases where dynamically injected non blocking images would still want to be lazy loaded. I am also using Angular and loading lots of images with the Flickr API. I only have a certain amount of bandwidth that I am allowed to use. In this case I do not want to load 500 images just because they are "non blocking". I'm sure other people that host their own assets do want to to pay to serve up images unnecessarily.

@vvo
Copy link

vvo commented Jul 23, 2014

@neptunian @ericandrewlewis Good point.

@neptunian Can you create a http://jsfiddle.net/ example using angular so we can both work on it?

I am sure there's an easy solution, just start an example we can both work on.

@neptunian
Copy link

@vvo have you seen this lib: https://github.com/dinbror/blazy
It has a public function called revalidate() that the developer can call when needed. I think this is all people are looking for: a way to recheck the page for newly inserted img elements.

@vvo
Copy link

vvo commented Jul 24, 2014

@neptunian I see, that's handy.

As for lazyload, it's only one function right now. Providing an object with multiple functions on it would be feasible.

But it would mean refactoring the library heavily. Because right now it's just one function.

As the needed behavior is already feasible, without modifying the library.
By calling the "lzld" method on every newly inserted image/dynamically inserted image.

I don't see this as a big threat. Try it, try to create a jsfiddle, the current API can do what you want.

It is not as magic as blazy, I understand.

@vvo
Copy link

vvo commented Jul 24, 2014

One very important note, the way blazy works is by asking the DOM for images to load. While lazyload works by using images that will register themselves to the lazyload script.

It's a very different design, lazyload used to work like how blazy works. But we sawy that on real websites with heavy JavaScripts and a lot of initializers/dom ready events listeners, our images were not loaded as fast as we thought on page load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants