Open ghost opened 8 years ago
The following code is working and tested on Google Chrome, Microsoft Edge and Internet Explorer 11
jQuery(document).ready(function($) {
var beforePrint = function() {
$('img').trigger('unveil');
};
if (window.matchMedia) {
var mediaQueryList = window.matchMedia('print');
mediaQueryList.addListener(function(mql) {
if (mql.matches) {
beforePrint();
}
});
}
window.onbeforeprint = beforePrint;
});
I'd like to be able to print webpages with the lazyloaded images without having to scroll all the way down to load them first – my understanding is that this can be done by triggering unveil with "window.onbeforeprint," though it is not well supported...
here's the code I have:
Still not seeing all the images on the print screen, though. Any ideas on how to get unveil to work for printing?