bootstrap PrintThis打印插件使用詳解
bootstrap PrintThis打印效果圖:

如圖,這個(gè)是調(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("等待打印");
});
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
JavaScript 中有關(guān)數(shù)組對(duì)象的方法(詳解)
下面小編就為大家?guī)?lái)一篇JavaScript 中有關(guān)數(shù)組對(duì)象的方法(詳解)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-08-08
瀑布流的實(shí)現(xiàn)方式(原生js+jquery+css3)
這篇文章主要為大家詳細(xì)介紹了原生js+jquery+css3實(shí)現(xiàn)瀑布流的相關(guān)代碼,三種實(shí)現(xiàn)瀑布流的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-07-07
JS實(shí)現(xiàn)模仿微博發(fā)布效果實(shí)例代碼
這篇文章主要介紹了JS實(shí)現(xiàn)模仿微博發(fā)布效果實(shí)例代碼,有需要的朋友可以參考一下2013-12-12
基于javascript制作經(jīng)典傳統(tǒng)的拼圖游戲
這篇文章主要為大家詳細(xì)介紹了基于javascript制作拼圖游戲的相關(guān)內(nèi)容,經(jīng)典傳統(tǒng)的拼圖游戲是大家最喜愛(ài)的游戲之一,具有挑戰(zhàn)性,感興趣的小伙伴們可以參考一下2016-03-03
For循環(huán)中分號(hào)隔開(kāi)的3部分的執(zhí)行順序探討
這篇文章主要探討了For循環(huán)中分號(hào)隔開(kāi)的3部分的執(zhí)行順序,需要的朋友可以參考下2014-05-05
JS圖片懶加載的優(yōu)點(diǎn)及實(shí)現(xiàn)原理
這篇文章主要介紹了JS圖片懶加載的優(yōu)點(diǎn)及實(shí)現(xiàn)原理,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-01-01
js實(shí)現(xiàn)簡(jiǎn)單的左右兩邊固定廣告效果實(shí)例
這篇文章主要介紹了js實(shí)現(xiàn)簡(jiǎn)單的左右兩邊固定廣告效果,實(shí)例分析了javascript實(shí)現(xiàn)固定廣告的技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-04-04
iframe里使用JavaScript控制主頁(yè)轉(zhuǎn)向的方法
這篇文章主要介紹了iframe里使用JavaScript控制主頁(yè)轉(zhuǎn)向的方法,涉及使用javascript實(shí)現(xiàn)iframe頁(yè)面跳轉(zhuǎn)的技巧,需要的朋友可以參考下2015-04-04

