The mod you link to in your post is for version 2.04 of Lightbox and is not compatible with version 2.03 or any of the mods for it.
The print stylesheet recommendations as amended later in that thread (to use position fixed) should work for most browsers in either version. But for compatibility with IE 6 use (also works with modern browsers):
Code:
* {
display: none;
}
html, body, #lightbox, #outerImageContainer, #imageContainer, #lightboxImage {
background: none;
display: block;
left: 0!important;
margin: 0!important;
padding: 0!important;
position: absolute;
top: 0!important;
}
The changes to the version 2.03 script should be (search for the unhighlighted, add the highlighted):
Create an image for the print-button, and add an image reference:
Code:
var fileBottomNavCloseImage = "images/closelabel.gif";
var fileBottomNavPrintImage = "images/printlabel.gif";
Then add a print-button next to the close-button in the Lightbox container and set its onclick:
Code:
var objBottomNav = document.createElement("div");
objBottomNav.setAttribute('id','bottomNav');
objImageData.appendChild(objBottomNav);
if(window.print){
var objBottomNavPrintLink = document.createElement("a");
objBottomNavPrintLink.setAttribute('id','bottomNavPrintLink');
objBottomNavPrintLink.setAttribute('href','#');
objBottomNavPrintLink.onclick = function() { print(); return false; }
objBottomNav.appendChild(objBottomNavPrintLink);
var objBottomNavPrintImage = document.createElement("img");
objBottomNavPrintImage.setAttribute('src', fileBottomNavPrintImage);
objBottomNavPrintLink.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);
Some additional tweaks, particularly to the styles may be required. Like you may need to style the bottomNavPrintLink in lightbox.css (one possible way):
Code:
#imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; }
#imageData #bottomNavPrintLink{ width: 66px; float: right; padding-bottom: 0.7em; padding-left: 0.7em;}
But it might work out fine without that, or you may choose different styles for it, to get it to line up and/or appear differently.
Don't use the lightbox.css stylesheet from version 2.04 with version 2.03. It won't work entirely right (mostly, just messes up some things some times) in 2.03.
Bookmarks