bootstrap PrintThis打印插件使用详解

bootstrap PrintThis打印效果图:

bootstrap PrintThis打印插件使用详解

如图,这个是调用了谷歌的打印,使用很方便,可以自己調样式,需要的可以研究一下,这边贴出使用方法。

附上GitHub:https://github.com/jasonday/printThis
jsp:

<script src="<%=basePath %>bootstrap/js/printThis.js"></script>

<!-- 二维码弹出框 --> <div tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div role="document"> <div> <div> <button type="button" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4>二维码</h4> </div> <div> <center> <div></div> <table> <tbody> <tr> <td> <label for="equ_name_qrcode"><h7>设备名称:</h7></label> <div> <input type="text"/> </div> </td> <td> <label for="equ_ip_qrcode"><h7>设备IP:</h7></label> <div> <input type="text"/> </div> </td> </tr> </tbody> </table> </center> </div> <div> <button type="button" data-dismiss="modal"> <span aria-hidden="true"></span>关闭 </button> <button type="button" data-dismiss="modal"> <span aria-hidden="true"></span>打印 </button> </div> </div> </div> </div>

js:

$("#btn_print").click(function(event) { /* Act on the event */ $("#qrcode").printThis({ debug: false, importCSS: false, importStyle: false, printContainer: true, // loadCSS: "/Content/Themes/Default/style.css", pageTitle: "二维码", removeInline: false, printDelay: 333, header: null, formValues: false }); // alert("等待打印"); });

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwzsyx.html