vvo / lazyload

:bullettrain_front: Lazyload images, iframes, widgets with a standalone JavaScript lazyloader
https://vvo.github.io/lazyload/
MIT License
938 stars 158 forks source link

embed tag #75

Open marin-df opened 8 years ago

marin-df commented 8 years ago

Thank you for this great script.

I look forward to the possibility of lazy loading on div background . I could carry on my side by adding an image below <img> that has the role of background . But the code is not very beautiful.

I just used your script on embed tags for flash files . This works but you have to know two things : onload does not work on embed tag and Chrome does not support the change src ( you have to refresh the parent content)

I achieved this by adding an ID to the embed and via the function:

function lzldEmbed(e) { e = document.getElementById(e); var s = setInterval(function(){ if (e.src!='') { var c = e.parentElement; c.innerHTML = c.innerHTML; clearInterval(s); } },100); lzld(e); }

vvo commented 8 years ago

It seems you have mutliple requests/issues here:

About the second question, maybe you can submit a fix?