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)文章
jquery.cookie實(shí)現(xiàn)的客戶端購(gòu)物車操作實(shí)例
這篇文章主要介紹了jquery.cookie實(shí)現(xiàn)的客戶端購(gòu)物車操作,結(jié)合實(shí)例形式分析了jQuery基于cookie存儲(chǔ)及操作數(shù)據(jù)實(shí)現(xiàn)購(gòu)物車功能的技巧,需要的朋友可以參考下2015-12-12
jquery基本選擇器匹配多個(gè)元素的實(shí)現(xiàn)方法
下面小編就為大家?guī)?lái)一篇jquery基本選擇器匹配多個(gè)元素的實(shí)現(xiàn)方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-09-09
jQuery-ui中自動(dòng)完成實(shí)現(xiàn)方法
關(guān)于jQuery-ui-1.8中的自動(dòng)完成控件,其匹配方式是使用正則表達(dá)式進(jìn)行匹配的。2010-06-06
jQuery 實(shí)現(xiàn)評(píng)論等級(jí)好評(píng)差評(píng)特效
本文主要介紹如何實(shí)現(xiàn)類似淘寶好評(píng)差評(píng)的效果,需要的小伙伴直接拿去用吧。2016-05-05
jquery獲得同源iframe內(nèi)body下標(biāo)簽的值的方法
這篇文章主要介紹了jquery獲得同源iframe內(nèi)body下標(biāo)簽的值的方法,很簡(jiǎn)單,很實(shí)用,需要的朋友可以參考下2014-09-09

