I’m fetching link of images from server and then creating image elements dynamically using append method. Lazy images don’t seem to work on dynamic elements. How can i use lazy images in dynamically created elements
- make sure init lazy load module on containing page using
app.lazy.create
https://framework7.io/docs/lazy-load.html#lazy-load-app-methods - after you added images to DOM, F7 doesn’t know about it, you need too trigger
lazy
event to force this check https://framework7.io/docs/lazy-load.html#trigger-lazy-load-manually
It is possible to force lazy handler to check lazy images by triggering
lazy
event on lazy image/element. It is useful in case you have added lazy elements dynamically and want to check should them be loaded or not without scrolling the page
Thanks, that is exactly what i’m looking at