下載地址 http://doersguild.github.io/jQuery.print/
github地址 https://github.com/DoersGuild/jQuery.print
使用時直接引入js文件
<script type="text/JavaScript" src="path/to/jquery.print.js"></script>
<div id="ele"> <h1>印刷</h1> </div>
//使用時div的樣式不可設置為隱藏,可先隱藏,執行打印方法時利用js切換顯示效果,打印結束再隱藏
$("#ele").print(/*options*/); 或者使用下面的代碼
$("#ele").print({ globalStyles: true, mediaPrint: false, stylesheet: null, noPrintSelector: ".no-print", iframe: true, append: null, prepend: null, manuallyCopyFormValues: true, deferred: $.Deferred(), timeout: 750, title: null, doctype: '<!doctype html>' });