Jquery printing plug-in PrintArea for web Front-end printing

Source: Internet
Author: User

Step 1:
Download jquery. PrintArea. js
Js reference Copy codeThe Code is as follows: <script language = "javascript" src = "jquery-1.7.1.min.js"> </script>
<Script type = "text/javascript" src = "jquery. PrintArea. js"> </script>

Html reference:Copy codeThe Code is as follows: <div class = "my_show">
This is displayed during printing.
</Div>
<Div class = "my_hidden">
This is hidden during printing.
</Div>
<Input type = "button" id = "print"/>

Javascript code:Copy codeThe Code is as follows: $ (document). ready (function (){
$ ("# Print"). click (function (){
$ (". My_show"). printArea ();
});
});

This plug-in also provides some configurable parameters, using $ (element). printArea (option ).
I have never used this method. If you have any questions, please leave a message.

Parameter settings:
1. mode: mode. It is triggered when the print button is clicked. The default mode is iframe. When it is set to popup, a new window page is printed.
2. popTitle: Set the title of the new window. The default value is null.
3. popClose: whether to close the window after printing is completed. The default value is false.

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.