GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Way to print one image from a page? (https://gfy.com/showthread.php?t=1079787)

Lace 08-30-2012 07:47 AM

Way to print one image from a page?
 
Trying to find out a way to print a selected image from a page.

It's a coupon page, with 14 coupons at the moment. I need to find a way to set it up where when you click on an image, it sends just that image to a printer.

Or better yet, have check boxes to select which to print, then have a print button below.


Anyone know of any easy options off hand?

Thanks :thumbsup

potter 08-30-2012 08:02 AM

You could use jquery to on-click of an image, (hide) all images except the one clicked on, and then fire the print function. That way the page should only print the image desired.

Something like
Code:

$('div.container img').click(function() {
    $('div.container img').hide();
    $(this).show();
    window.print();
});


Lace 08-30-2012 08:29 AM

Quote:

Originally Posted by potter (Post 19153799)
You could use jquery to on-click of an image, (hide) all images except the one clicked on, and then fire the print function. That way the page should only print the image desired.

Something like
Code:

$('div.container img').click(function() {
    $('div.container img').hide();
    $(this).show();
    window.print();
});


Hmm...okay. I'll give this a shot first.

Thanks, potter!

livexxx 08-30-2012 08:32 AM

You can do it very easily to print just single elements with jQuery Print Area plugin

http://www.ssdtutorials.com/tutorial...ery-print.html

Code:

        $('.print').click(function() {
                var container = $(this).attr('rel');
                $('#' + container).printArea();
                return false;
        });

The demo on that page has a print button to print named elements on a page. You can create a new CSS element and wrap that around single images as well so that you can click an image and get it to print.

example below :
http://www.gotporn.com/print/

Lace 08-31-2012 07:36 AM

Quote:

Originally Posted by livexxx (Post 19153864)
You can do it very easily to print just single elements with jQuery Print Area plugin

http://www.ssdtutorials.com/tutorial...ery-print.html

Code:

        $('.print').click(function() {
                var container = $(this).attr('rel');
                $('#' + container).printArea();
                return false;
        });

The demo on that page has a print button to print named elements on a page. You can create a new CSS element and wrap that around single images as well so that you can click an image and get it to print.

example below :
http://www.gotporn.com/print/

Tried this, and it works fine until I put it into my template. I don't get it. Everything is set - the scripts, the div id's, etc. :(

marlboroack 08-31-2012 11:24 AM

Print screen it then paste it in paint then Ctrl- P

fris 08-31-2012 11:38 AM

also take a look at jqprint, i use it for a cms that allows you to only print the source code.


All times are GMT -7. The time now is 06:33 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc