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>設(shè)備名稱:</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>設(shè)備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>關(guān)閉
</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)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
JavaScript 中有關(guān)數(shù)組對象的方法(詳解)
下面小編就為大家?guī)硪黄狫avaScript 中有關(guān)數(shù)組對象的方法(詳解)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-08-08
瀑布流的實現(xiàn)方式(原生js+jquery+css3)
這篇文章主要為大家詳細介紹了原生js+jquery+css3實現(xiàn)瀑布流的相關(guān)代碼,三種實現(xiàn)瀑布流的方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-07-07
基于javascript制作經(jīng)典傳統(tǒng)的拼圖游戲
這篇文章主要為大家詳細介紹了基于javascript制作拼圖游戲的相關(guān)內(nèi)容,經(jīng)典傳統(tǒng)的拼圖游戲是大家最喜愛的游戲之一,具有挑戰(zhàn)性,感興趣的小伙伴們可以參考一下2016-03-03
For循環(huán)中分號隔開的3部分的執(zhí)行順序探討
這篇文章主要探討了For循環(huán)中分號隔開的3部分的執(zhí)行順序,需要的朋友可以參考下2014-05-05
iframe里使用JavaScript控制主頁轉(zhuǎn)向的方法
這篇文章主要介紹了iframe里使用JavaScript控制主頁轉(zhuǎn)向的方法,涉及使用javascript實現(xiàn)iframe頁面跳轉(zhuǎn)的技巧,需要的朋友可以參考下2015-04-04

