Brief tutorials
Jquery.print is a simple and powerful web content printing jquery plugin. The page print plug-in can print page elements in a specified area, you can specify that skipping does not print some elements, and you can print the entire page content. and provides a rich set of printing parameters.
How to use
Use this page to print plugins to introduce jquery and jquery.print.js files.
< script type = " Text/javascript " Code class= "HTML Color1" >src = "Js/jquery.min.js" ></ script > < script type = "Text/javascript" src = "Js/jquery.print.js" ></ script > |
The jquery version has been tested in 1.7.2 and version 1.9.1. Other versions should be tested on their own.
Print Content
You can use this to print the content of the page as follows.
$( "#myElementId" ).print( /*options*/ ); |
Or:
$.print( "#myElementId" /*, options*/ ); |
Configuration Parameters
You can pass in some parameters when you call the Print method:
$(
"#myElementId"
).print({
globalStyles:
true
,
mediaPrint:
false
,
stylesheet:
null
,
noPrintSelector:
".no-print"
,
iframe:
true
,
append:
null
,
prepend:
null
,
manuallyCopyFormValues:
true
,
deferred: $.Deferred()
});
|
Parameters |
Default value |
Receive value |
Describe |
Globalstyles |
true |
Boolean |
Whether to include the style of the parent document |
Mediaprint |
false |
Boolean |
Whether media=‘print‘ to include the link label. will be globalStyles overwritten by the option |
Stylesheet |
null |
Url-string |
The URL address of the external style sheet |
Noprintselector |
".no-print" |
Any of the available jquery selectors |
jquery selector for elements that you do not want to print |
Iframe |
By default true , if no IFRAME selector is passed in to create a hiddeniframe |
Any jquery selector or Boolean that is available |
Whether to use an IFRAME instead of a pop-up window to print the form |
Append/prepend |
null |
Boolean |
Whether to use user-updated form input box content as printed content (by iterating through each of the form elements) |
jquery Easy-to-use web content print Plugin