PDA

View Full Version : Adding a "save as" button to Lightbox



simpleuser
09-10-2011, 11:13 PM
1) Script Title: Lightbox image viewer 2.03a

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

3) Describe problem: Looking for a way to add a button/image to the caption area in Lightbox to allow users to be able to save the larger image once they have clicked on the thumbnail,I know that I can set a print button but can a save as button be made, as far as I understand you cannot right click saves as with Lightbox anyone got any ideas...

mburt
09-11-2011, 03:21 AM
Hm, I think the best you can do is instruct your clients to "right-click then save-as", it's a fairly common thing.

You'd have to use PHP to change the headers of a link to that image to force a download, and this doesn't really seem to be an option in conjunction with the lightbox.

simpleuser
09-11-2011, 08:43 PM
Thanks for replying...I will use what you suggested....and if I find anything that allows this I will post for others that might need..

jscheuer1
09-12-2011, 03:07 PM
It's true, if you have a next/prev lightbox group you cannot right click the image, but you could include a link to the image in the caption or even a very scaled down rendering of the image. This could be right clicked and saved as. And, f you have a server side language like PHP or asp, you can make a button that would open the browser's open/save dialog. But I would recommend using a different 'box' script. Lightbox 2.03a is a bit outdated. And though it is widely recognized as the original Lightbox, Lightbox (currently at 2.05 I think) itself isn't necessarily the best of the current choices for a 'box' script.

phpzag
09-07-2012, 07:04 AM
you can make changes to lightbox.js


$('<div/>', {
"class": 'lb-saveContainer'
}).append($('<a/>', {
"href": '',
"target":"_blank"
}).append($('<img/>', {
src: this.options.fileSaveImage
})))