前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >jquery-barcode:js实现的条码打印

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

作者头像
菩提树下的杨过
发布2018-01-24 10:53:19
3.6K0
发布2018-01-24 10:53:19
举报

这是一个纯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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014-04-03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档