Javascript-tool:jquery.jsprint.js

Source: Internet
Author: User

A number of projects need to achieve page printing, especially some background management system, the following introduction of a lightweight print plugin:

1, implement the page printing to introduce jquery and Jqprint. Click to download Jqprint plugin

<language= "javascript"  src= "Jquery-1.4.4.min.js"> </script><language= "JavaScript"  src= "Jquery.jqprint-0.3.js"></script>

2. HTML code:

<DivID= "Print-area">        <Table>            <TR>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>            </TR>            <TR>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>            </TR>            <TR>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>            </TR>            <TR>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>            </TR>            <TR>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>                <TD>Test</TD>            </TR>        </Table>    </Div>    <inputtype= "button"onclick= "Print ()"value= "Print">

3. JavaScript code:

<script language= "JavaScript" >    function  print () {        $ ("#print-area"). Jqprint ({            false,                        true,                     true,                 false          });     </script>

4. Properties

    1. Debug:false,//True to display the IFrame view effect (the IFRAME default height and width are very small, can be increased in the source code), the default is False
    2. Importcss:true,//true represents the introduction of the original page of the CSS, the default is true. (If True, you will find $ ("link[media=Print]"), if you do not find the CSS file in $ ("link" )
    3. Printcontainer:true,//indicates that if the original selected object must be included in the print (note: setting to false may break your CSS rules).
    4. Operasupport:false//indicates that if the plugin must also support the Opera browser, in this case it provides a temporary print tab. The default is True

5. Special print style

If you need a unique CSS style when printing, you can also write it directly within the style property by

<href= "Printstyle.css"  reltype= "Text/css"  Media= "print">

To reference the styles in an external CSS file. The benefit is that the style will only be applied when printing.

2.
3. back to top
4. back to top
5. back to top
1, 1.1, http://www.jq22.com/jquery-info3471.2, HTTPS://WWW.JB51.NET/ARTICLE/102230.HTM2,
6. back to top
Ylbtech
Source: http://ylbtech.cnblogs.com/
This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

Javascript-tool:jquery.jsprint.js

Related Article

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.