Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazyload and printing #104

Open
markusweb opened this issue Mar 24, 2013 · 5 comments
Open

Lazyload and printing #104

markusweb opened this issue Mar 24, 2013 · 5 comments

Comments

@markusweb
Copy link

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">
@websirnik
Copy link

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

@fheraty
Copy link

fheraty commented Mar 17, 2015

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

@raphaelparent
Copy link

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

Thanks!

@verlok
Copy link

verlok commented Oct 11, 2018

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.

@jsfgreen
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants