lazyload icon indicating copy to clipboard operation
lazyload copied to clipboard

Lazyload and printing

Open markusweb opened this issue 12 years ago • 5 comments

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">

markusweb avatar Mar 24 '13 14:03 markusweb

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

websirnik avatar Jan 30 '14 16:01 websirnik

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

fheraty avatar Mar 17 '15 09:03 fheraty

Hello! I was wondering if any proper solution was found when exploring around lazyload and printing.

Thanks!

raphaelparent avatar Jan 16 '17 18:01 raphaelparent

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.

verlok avatar Oct 11 '18 21:10 verlok

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.

jsfgreen avatar Mar 30 '19 05:03 jsfgreen