A variety of front-end printing methods of the Web jquery print plug-in printarea implementation of Web page printing _jquery

Source: Internet
Author: User
First Step
Jquery. Printarea.js Download
JS Reference
Copy Code code 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 Code code as follows:

<div class= "My_show" >
This is displayed when printed.
</div>
<div class= "My_hidden" >
This is hidden when printing.
</div>
<input type= "button" id= "Print"/>

JavaScript code
Copy Code code as follows:

$ (document). Ready (function () {
$ ("#print"). Click (function () {
$ (". My_show"). PrintArea ();
});
});

The plugin also provides some parameters to configure, using the method: $ (Element). PrintArea (option).
This method I have not used, we try to be, there is a problem message ha.

parameter Settings
1.mode: Mode, 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 newly opened window, the default is null.
3.popClose: Closes the window when finished printing, and defaults to 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.