jquery-barcode:js实现的条码打印

简介: 这是一个纯js的jQuery插件,项目地址:http://barcode-coder.com/en/barcode-jquery-plugin-201.html 使用示例: 1 doctype html> 2 3 4 jQuery Barcode ...

这是一个纯js的jQuery插件,项目地址:http://barcode-coder.com/en/barcode-jquery-plugin-201.html

使用示例:

 1 <!doctype html>
 2 <html>
 3     <head>
 4         <title>jQuery Barcode</title>
 5         <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
 6         <script type="text/javascript" src="jquery-barcode.js"></script>
 7         <style type="text/css">
 8         .barcodeImg{margin:10px 0px}
 9         </style>
10     </head>
11     <body>
12         <div style="margin:10px">    
13             <input id="src" value="11225921991"></input><br/>                
14             <input type="button" onclick='code11()' value="code11">     
15             <input type="button" onclick='code39()' value="code39"> 
16             <input type="button" onclick='code93()' value="code93">
17             <input type="button" onclick='code128()' value="code128">
18             <input type="button" onclick='ean8()' value="ean8">         
19             <input type="button" onclick='ean13()' value="ean13">
20             <input type="button" onclick='ean13()' value="std25">
21             <input type="button" onclick='int25()' value="int25">
22             <input type="button" onclick='msi()' value="msi">
23             <input type="button" onclick='datamatrix()' value="datamatrix">
24             <div id="bcTarget" class="barcodeImg"></div>            
25         </div>
26 
27         <script type="text/javascript">
28 
29 
30         function code11(){
31             $("#bcTarget").empty().barcode($("#src").val(), "code11",{barWidth:2, barHeight:30,showHRI:false});
32         }
33 
34         function code39(){
35             $("#bcTarget").empty().barcode($("#src").val(), "code39",{barWidth:2, barHeight:30,showHRI:false});
36         }
37 
38         function code93(){
39             $("#bcTarget").empty().barcode($("#src").val(), "code93",{barWidth:2, barHeight:30,showHRI:false});
40         }
41 
42         function code128(){
43             $("#bcTarget").empty().barcode($("#src").val(), "code128",{barWidth:1, barHeight:30,showHRI:false});
44         }
45 
46         function ean8(){
47             $("#bcTarget").empty().barcode($("#src").val(), "ean8",{barWidth:2, barHeight:30,showHRI:false});
48         }
49 
50         function ean13(){
51             $("#bcTarget").empty().barcode($("#src").val(), "ean13",{barWidth:2, barHeight:30,showHRI:false});
52         }
53 
54         function std25(){
55             $("#bcTarget").empty().barcode($("#src").val(), "std25",{barWidth:2, barHeight:30,showHRI:false});
56         }
57 
58         function int25(){
59             $("#bcTarget").empty().barcode($("#src").val(), "int25",{barWidth:2, barHeight:30,showHRI:false});
60         }
61 
62         function msi(){
63             $("#bcTarget").empty().barcode($("#src").val(), "msi",{barWidth:2, barHeight:30,showHRI:false});
64         }
65 
66         function datamatrix(){
67             $("#bcTarget").empty().barcode($("#src").val(), "datamatrix",{barWidth:2, barHeight:30,showHRI:false});
68         }
69         </script>
70 
71     </body>
72 </html>

示例源码地址:jquery-barcode.zip

目录
相关文章
|
7月前
|
JavaScript
jQuery fullpage.js 全屏分页以及动画使用
jQuery fullpage.js 全屏分页以及动画使用
39 0
|
14天前
|
JavaScript 前端开发
JQuery和JS的区别有哪些?
JQuery和JS的区别有哪些?
13 0
|
1月前
|
JavaScript
jQuery选择器案例之——index.js
jQuery选择器案例之——index.js
8 0
|
7月前
|
JavaScript
jQuery lazyload.js 懒加载可视范围图片
jQuery lazyload.js 懒加载可视范围图片
40 0
|
7月前
|
JavaScript
jQuery jquery.color.js 背景颜色支持动画
jQuery jquery.color.js 背景颜色支持动画
68 0
|
3月前
|
JavaScript
jQuery事件2-第6次课-给未来的元素绑事件-事件对象-JS盒模型-附案例、任务
jQuery事件2-第6次课-给未来的元素绑事件-事件对象-JS盒模型-附案例、任务
39 0
|
3月前
|
JavaScript 前端开发
jQuery事件1-第5次课-JQ的事件跟JS一样的作用,只是写法不一样-附案例、任务
jQuery事件1-第5次课-JQ的事件跟JS一样的作用,只是写法不一样-附案例、任务
39 0
|
3月前
|
JavaScript 前端开发 API
jquery是什么-是否还有必要学-与JS的区别-学习技巧-文末附资料、案例、作业
jquery是什么-是否还有必要学-与JS的区别-学习技巧-文末附资料、案例、作业
40 0
|
3月前
|
JavaScript 前端开发
原生js与jQuery显示隐藏div的几种方法
原生js与jQuery显示隐藏div的几种方法
38 0
|
3月前
|
JavaScript
多条件搜索(单条件也可以)原生js/jquery
多条件搜索(单条件也可以)原生js/jquery
25 0