dinbror / blazy

Hey, be lazy! bLazy.JS is a lightweight pure JavaScript script for lazy loading and multi-serving images. It's working in all modern browsers including IE7+.
http://dinbror.dk/blazy
MIT License
2.63k stars 355 forks source link

Is it possible to use JS to alter src to data-src on iframe? #179

Open uglyeoin opened 5 years ago

uglyeoin commented 5 years ago

If I want to use this on an iFrame I need to manually rename them all from src to data-src. This should probably be done on document load.

Blazy doesn't work on document load does it? Is there a solution to this?

dinbror commented 3 years ago

@uglyeoin I would do it in the html so you initialize the markup with data-src. But answering you question, yes its possible buy you need to do it as early as possible

uglyeoin commented 3 years ago

But it is not HTML this is a CMS, so things are load dynamically. I'll see if there is a way to do it earlier in the process.