Hi All,
I’ve been trying to add a print button next to the close button in lightbox but I’m having some trouble. Here’s what I’ve tried so far:
In lightbox_lang_en.js I’ve added this:
var fileBottomNavPrintImage = "assets/snippets/maxigallery/lightboxv2/images/printlabel.gif";
In lightbox.js I’ve added this:
//Added By N Hoag for Printing
var objBottomNavPrintLink = document.createElement("a");
objBottomNavPrintLink.setAttribute('id','bottomNavPrint');
objBottomNavPrintLink.setAttribute('href','#');
objBottomNavPrintLink.onclick = window.print();
objBottomNav.appendChild(objBottomNavPrintLink);
//Added By N Hoag for Printing
var objBottomNavPrintImage = document.createElement("img");
objBottomNavPrintImage.setAttribute('src', fileBottomNavPrintImage);
objBottomNavPrintImage.appendChild(objBottomNavPrintImage);
var objBottomNavCloseLink = document.createElement("a");
objBottomNavCloseLink.setAttribute('id','bottomNavClose');
objBottomNavCloseLink.setAttribute('href','#');
objBottomNavCloseLink.onclick = function() { myLightbox.end(); return false; }
objBottomNav.appendChild(objBottomNavCloseLink);
var objBottomNavCloseImage = document.createElement("img");
objBottomNavCloseImage.setAttribute('src', fileBottomNavCloseImage);
objBottomNavCloseLink.appendChild(objBottomNavCloseImage);
I’ve also created a print stylesheet for when you click the print button. This doesn’t work but I’m not sure what else I need to add. Any thought/tips would be much appreciated!