bootstrap PrintThis打印插件使用詳解
更新時間:2017年02月20日 17:15:31 作者:Java軟件小白
這篇文章主要為大家詳細介紹了bootstrap PrintThis打印插件的使用方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下
bootstrap PrintThis打印效果圖:
如圖,這個是調(diào)用了谷歌的打印,使用很方便,可以自己調(diào)樣式,需要的可以研究一下,這邊貼出使用方法。
附上GitHub:https://github.com/jasonday/printThis
jsp:
<script src="<%=basePath %>bootstrap/js/printThis.js"></script>
<!-- 二維碼彈出框 --> <div class="modal fade" id="myModal_qrcode" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel">二維碼</h4> </div> <div class="modal-body"> <center> <div id="qrcode"></div> <table> <tbody> <tr> <td> <label class="col-sm-4 control-label" for="equ_name_qrcode"><h7>設備名稱:</h7></label> <div class="col-sm-8"> <input class="form-control" id="equ_name_qrcode" type="text"/> </div> </td> <td> <label class="col-sm-4 control-label" for="equ_ip_qrcode"><h7>設備IP:</h7></label> <div class="col-sm-8"> <input class="form-control" id="equ_ip_qrcode" type="text"/> </div> </td> </tr> </tbody> </table> </center> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>關閉 </button> <button type="button" id="btn_print" class="btn btn-primary" data-dismiss="modal"> <span class="glyphicon glyphicon-floppy-disk" 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("等待打印"); });
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
JavaScript 中有關數(shù)組對象的方法(詳解)
下面小編就為大家?guī)硪黄狫avaScript 中有關數(shù)組對象的方法(詳解)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-08-08瀑布流的實現(xiàn)方式(原生js+jquery+css3)
這篇文章主要為大家詳細介紹了原生js+jquery+css3實現(xiàn)瀑布流的相關代碼,三種實現(xiàn)瀑布流的方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-07-07基于javascript制作經(jīng)典傳統(tǒng)的拼圖游戲
這篇文章主要為大家詳細介紹了基于javascript制作拼圖游戲的相關內(nèi)容,經(jīng)典傳統(tǒng)的拼圖游戲是大家最喜愛的游戲之一,具有挑戰(zhàn)性,感興趣的小伙伴們可以參考一下2016-03-03For循環(huán)中分號隔開的3部分的執(zhí)行順序探討
這篇文章主要探討了For循環(huán)中分號隔開的3部分的執(zhí)行順序,需要的朋友可以參考下2014-05-05iframe里使用JavaScript控制主頁轉(zhuǎn)向的方法
這篇文章主要介紹了iframe里使用JavaScript控制主頁轉(zhuǎn)向的方法,涉及使用javascript實現(xiàn)iframe頁面跳轉(zhuǎn)的技巧,需要的朋友可以參考下2015-04-04