jQuery插件jquery-barcode實(shí)現(xiàn)條碼打印的方法
本文實(shí)例講述了jQuery插件jquery-barcode實(shí)現(xiàn)條碼打印的方法。分享給大家供大家參考,具體如下:
這是一個(gè)純js的jQuery插件,項(xiàng)目地址:http://barcode-coder.com/en/barcode-jquery-plugin-201.html
使用示例:
<!doctype html>
<html>
<head>
<title>jQuery Barcode</title>
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="jquery-barcode.js"></script>
<style type="text/css">
.barcodeImg{margin:10px 0px}
</style>
</head>
<body>
<div style="margin:10px">
<input id="src" value="11225921991"></input><br/>
<input type="button" onclick='code11()' value="code11">
<input type="button" onclick='code39()' value="code39">
<input type="button" onclick='code93()' value="code93">
<input type="button" onclick='code128()' value="code128">
<input type="button" onclick='ean8()' value="ean8">
<input type="button" onclick='ean13()' value="ean13">
<input type="button" onclick='ean13()' value="std25">
<input type="button" onclick='int25()' value="int25">
<input type="button" onclick='msi()' value="msi">
<input type="button" onclick='datamatrix()' value="datamatrix">
<div id="bcTarget" class="barcodeImg"></div>
</div>
<script type="text/javascript">
function code11(){
$("#bcTarget").empty().barcode($("#src").val(), "code11",{barWidth:2, barHeight:30,showHRI:false});
}
function code39(){
$("#bcTarget").empty().barcode($("#src").val(), "code39",{barWidth:2, barHeight:30,showHRI:false});
}
function code93(){
$("#bcTarget").empty().barcode($("#src").val(), "code93",{barWidth:2, barHeight:30,showHRI:false});
}
function code128(){
$("#bcTarget").empty().barcode($("#src").val(), "code128",{barWidth:1, barHeight:30,showHRI:false});
}
function ean8(){
$("#bcTarget").empty().barcode($("#src").val(), "ean8",{barWidth:2, barHeight:30,showHRI:false});
}
function ean13(){
$("#bcTarget").empty().barcode($("#src").val(), "ean13",{barWidth:2, barHeight:30,showHRI:false});
}
function std25(){
$("#bcTarget").empty().barcode($("#src").val(), "std25",{barWidth:2, barHeight:30,showHRI:false});
}
function int25(){
$("#bcTarget").empty().barcode($("#src").val(), "int25",{barWidth:2, barHeight:30,showHRI:false});
}
function msi(){
$("#bcTarget").empty().barcode($("#src").val(), "msi",{barWidth:2, barHeight:30,showHRI:false});
}
function datamatrix(){
$("#bcTarget").empty().barcode($("#src").val(), "datamatrix",{barWidth:2, barHeight:30,showHRI:false});
}
</script>
</body>
</html>
運(yùn)行效果截圖如下:

完整實(shí)例代碼代碼點(diǎn)擊此處本站下載。
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
相關(guān)文章
ASP.NET jQuery 實(shí)例11 通過(guò)使用jQuery validation插件簡(jiǎn)單實(shí)現(xiàn)用戶登錄頁(yè)面驗(yàn)證功能
從這節(jié)開(kāi)始,我們開(kāi)始學(xué)習(xí)如何在ASP.NET控件中使用jQuery validation 插件,首先要用它,必須先了解它有什么用2012-02-02
jCallout 輕松實(shí)現(xiàn)氣泡提示功能
在提交表單前、焦點(diǎn)轉(zhuǎn)移后或者 keyup 時(shí)往往需要對(duì)輸入的文本就行檢驗(yàn),如果輸入內(nèi)容不符合相關(guān)約定則要進(jìn)行提示或警告,有一個(gè)叫 jCallout 的插件可以輕松實(shí)現(xiàn)該功能,該插件基于 jQuery 使用,所以使用前需要添加引用 jQuery2013-09-09
jQuery.fn和jQuery.prototype區(qū)別介紹
jQuery.fn和jQuery.prototype想必大家對(duì)它并不陌生吧,那么你們知道它們之間的區(qū)別嗎?在本文有個(gè)不錯(cuò)的示例大家可以參考下2013-10-10
基于jQuery實(shí)現(xiàn)的扇形定時(shí)器附源碼下載
這篇文章給大家介紹基于jquery實(shí)現(xiàn)的扇形定時(shí)器,涉及到pietimer知識(shí)點(diǎn)的學(xué)習(xí),對(duì)jquery定時(shí)器感興趣的朋友一起了解了解吧2015-10-10
淺談JQ中mouseover和mouseenter的區(qū)別
下面小編就為大家?guī)?lái)一篇淺談JQ中mouseover和mouseenter的區(qū)別。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。2016-09-09
jQuery實(shí)現(xiàn)在textarea指定位置插入字符或表情的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)在textarea指定位置插入字符或表情的方法,實(shí)例分析了jQuery操作表單元素的技巧,非常實(shí)用,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03
jQuery簡(jiǎn)單動(dòng)畫(huà)變換效果實(shí)例分析
這篇文章主要介紹了jQuery簡(jiǎn)單動(dòng)畫(huà)變換效果,結(jié)合實(shí)例形式分析了jQuery使用toggle及animate等方法動(dòng)態(tài)操作頁(yè)面元素樣式的相關(guān)技巧,需要的朋友可以參考下2016-07-07
jquery 動(dòng)態(tài)遍歷select 賦值的實(shí)例
今天小編就為大家分享一篇jquery 動(dòng)態(tài)遍歷select 賦值的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-09-09

