lazyload
lazyload copied to clipboard
Lazyload and printing
lazyload works great, when scrolling down the images are beeing loaded. but when i print the page i only will see the "placeholder" no image is beeing loaded. can this somehow be achieved?
i have tried to add an onbeforeprint-listener. i also could call trigger('appear')
window.onbeforeprint = function () {
$("img.lazy").each(function() { $(this).trigger("appear"); console.log(1)});
}
i can see all the images loaded, but when i then print in firefox the images are hidden again - i think firefox "reloads" the page from server. i also tried the noscript but this does not work. can i do it other then
<img class="lazy" src="/_standards/leer.gif" data-original="<%firstPhotoThumb%>" width="120" height="120">
<img class="print-only" src="<%firstPhotoThumb%>" width="120" height="120">
This is also bothering me. Neither of the methods described above haven't worked for me:
- the first solution dialog fails to load all images, as there are no much time for window to do so.
- second solution loads all images on page load, which some thing I want to avoid using this library
Hi. Just wondered if anyone had found a solution on this as I'm having the same issue in that the printed doc displays loaded images ok but placeholders for the unloaded lazyload ones. Just wondered if there was an extra plug-in perhaps (I'm using Lazy Load 1.9.3).
Thanks in advance
Hello! I was wondering if any proper solution was found when exploring around lazyload and printing.
Thanks!
Hello!
I'm the author of the vanilla-lazyload script and I've recently developed a feature that makes print of all images possible!
Tested cross browser using this repo code which is live here.
Take a look and let me know what you think! I'm open to pull requests on GitHub of course.
I use the same onbeforeprint solution, it's buggy in Firefox. I think the event fires before the print dialog but after it's already too late. Either way, all I get are the alt's in the print preview.
Relying on a print button is a lousy workaround. It's a shame.