JQuery print part of div only
Posted in JQuery, Uncategorized on May 19th, 2010 by taswar
So here is an interesting jquery plugin called jqprint it allows one to specify any element and sent it to print.
Assuming you have an element with id printButton and a content area called divToPrint
1 2 3 | $('#printButton').live('click', function() { $('#divToPrint').jqprint(); }); |
This will pop up the print functionality in your browser and send it with the default media=”print” css or else it picks up your default css. Kind of neat.
One thing to be mindful of in Firefox is the overflow attribute in your css stylesheet if you have overflow: hidden you will only get one page to print only.
Example:
1 | body { overflow: hidden; } |
Remove the overflow and it would print all the pages of a div.
3 Responses
Leave a Comment

September 5th, 2010 at 10:16 am
demo page will be helpful
December 14th, 2012 at 7:19 pm
i love You for this maaan
January 14th, 2013 at 4:17 am
Hey, why don’t you post the library so that we can also try it out.
it’s a nice thing though.
Thanks a lot