PDA

View Full Version : How to embed button window in print and save “lightwindow”?



MALINOIS77
01-11-2014, 10:43 PM
Hello,

I build a site with "Lightwindow 2.0" (http://www.p51labs.com/lightwindow/) and I would like to add two buttons next to the "Close" button at the top right of the window.

The first button is the one to print only the content of the "lightwindow" window. I already have a "css" for printing my main pages but I want the visitor can also print only the content of the "lightwindow" window.

The second is that button to save only the contents of the "lightwindow" window that it is a direct content or a content "iframe".

For information, the reason is that in my windows are coloring pictures for children and I would like to give parents opportunities to either print the coloring page present in the "lightwindow" window or save it to their PC print later.

Thank you in advance ...

Regards,

jscheuer1
01-13-2014, 03:37 PM
Are people still using that script? Anyways, in this thread to which I link you to the code for that (printing a selective part of a page in a "box"):

http://www.dynamicdrive.com/forums/showthread.php?73040-Print-not-working-as-desired-in-Lightbox&p=291566#post291566

we worked with code for the printing part of that.

As for saving, an ordinary link to the image can be used as long as the user right clicks it and 'saves it as'. Or the image can be put in a .zip archive, most browsers will automatically save that when clicked. Anything more elaborate than that would require server side code to attempt to force a download on a left click. If you Have PHP available on your host, we can look into that.

For integrating this with Lightwindow, I would suggest using another "box" type script, one that's at least jQuery based. There are several good ones out there depending upon how much versatility you need:

http://www.digitalia.be/software/slimbox2

http://fancybox.net/

http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/#!prettyPhoto

http://code.google.com/p/easybox/

There are many others.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.