blazy icon indicating copy to clipboard operation
blazy copied to clipboard

bLazy with removed and added dom elements

Open dkeulen opened this issue 9 years ago • 2 comments

Hi there,

tldr: How do i use bLazy with elements that get removed and/or added to the dom?

First, thanks allot for a pure js lazyload script. Second, i have run into a problem and that problem is:

bLazy works great, except when i use a filter function to remove the element containing the image from the dom, and it gets added again when the filter requirement is met, the data-src does not get assigned to the src attribute.

Any idea what/why this is happening and how to counter this? The only solution i can think of now, is to trigger the bLazy function everytime i press a filter button.

dkeulen avatar Jan 20 '17 15:01 dkeulen

Hi @dkeulen.

I have it on my feature list, to auto detect async images. In the meantime you can call one of the public functions that comes with blazy, revalidate or load (http://dinbror.dk/blog/blazy/#Functions).

dinbror avatar Jan 26 '17 20:01 dinbror

got same issue: appended new markup via ajax to the page and I wpuld like to init again blazy for the images in the new markup.

Waiting updates :)

valeriosillari avatar Feb 19 '17 19:02 valeriosillari