Using CSS to control the print style, you need to set the style media= "print" and set the style display property of elements that do not need to be printed on the page to none. As in demo, I set the header footer and other elements that don't need to be printed as follows:
<style type= "text/css" media= "print" >
#header,. Top_title, #jqprint, #footer, #cssprint H3{display:none}
Using jquery to print Plug-ins printarea.js
$ (function () {
$ ("#print_btn"). Click (function () {
$ ("#my_area"). PrintArea ();
There is a piece of code in the demo:
<p><a href= "#" id= "PRINT_BTN" > click here to print >></a></p>
<div id= "My_area" >
... Print Area ...<br/>
When you click the Print button, the Printarea.js plug-in is invoked. The plug-in also provides some parameters to configure, using the method: $ (Element). PrintArea (option).
Parameter settings:
1, Mode: Model, when clicked on the Print button trigger mode, the default is IFRAME, when set to popup will open a new window page print.
2, Poptitle: Set the title of the new open window, the default is empty.
3, Popclose: The completion of the printing window is closed, the default is False.
Ps:ie Browser Print page to remove the header and Footer URL method: File-> page settings, the page and footer of the input box empty.
The above is a small set of jquery to introduce the implementation of regional printing function code detailed, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!