Results 1 to 5 of 5

Thread: Adding a "save as" button to Lightbox

  1. #1
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Adding a "save as" button to Lightbox

    1) Script Title: Lightbox image viewer 2.03a

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...box2/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...

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    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.
    - Mike

  3. #3
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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..

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2012
    Location
    India
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Add save button to lightbox

    you can make changes to lightbox.js

    Code:
     $('<div/>', {
            "class": 'lb-saveContainer'
          }).append($('<a/>', {
            "href": '',
    		 "target":"_blank"
          }).append($('<img/>', {
            src: this.options.fileSaveImage
          })))
    Last edited by jscheuer1; 09-07-2012 at 01:49 PM. Reason: Format , remove illegal sig/link

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •