jquery Easy-to-use web content print Plugin

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.