生成条形码_jQuery_barcode
2015-07-02 11:14
906 查看
<html>
<head>
<scripttype="text/javascript"src="jquery-1.3.2.min.js"></script>
<scripttype="text/javascript"src="jquery-barcode-2.0.1.js"></script>
<scripttype="text/javascript">
$(function(){
$("#bcTarget").barcode("1234567890128","ean13",{barWidth:2,barHeight:30});
});
</script>
</head>
<body>
<divid="bcTarget"></div>
</body>
</html>
[/code]
更多条码见条码开发工具包
生成
详细实例地址
<html>
<head>
<scripttype="text/javascript"src="jquery-1.3.2.min.js"></script>
<scripttype="text/javascript"src="jquery-barcode-2.0.1.js"></script>
<scripttype="text/javascript">
$(function(){
$("#bcTarget").barcode("123456789","codabar",{barWidth:2,barHeight:30});
$("#genid").click(function(){
varcode=$("#orgcode").val();
$("#mycode").barcode(code,"codabar",{barWidth:2,barHeight:30});
});
});
</script>
</head>
<body>
首先自动生成条形码123456789
<divid="bcTarget"></div>
输入要生成条形码的数字
<inputtype="text"id="orgcode">
<divid="mycode"></div>
<inputtype="button"value="生成条形码"id="genid"/>
</body>
</html>
[/code]
生成类型有多种
具体官方文档
Prototypeofthebarcodefunction
barcode:function(datas,type,settings)
datas
stringValuebarcode(dependentonthetypeofbarcode)
Ifbarcodetypeincludeit,thepresenceofthechecksumisnotmandatory,itiseautomaticallyrecalculated
object
type:ean8,ean13,code11,code39,code128,codabar | |
---|---|
member | Type |
code | string |
type:std25,int25,code93 | |
---|---|
member | Type |
code | string |
crc | boolean |
type:msi | |
---|---|
member | Type |
code | string |
crc | boolean |
object | crc1:string("mod10","mod11") |
crc2:string("mod10","mod11") |
type:datamatrix | |
---|---|
member | Type |
code | string |
rect | boolean(default:false) |
type(string)
codabarcode11(code11)
code39(code39)
code93(code93)
code128(code128)
ean8(ean8)
ean13(ean13)
std25(standard2of5-industrial2of5)
int25(interleaved2of5)
msi
datamatrix(ASCII+extended)
settings(object)
visualconfigurationofthebarcodeParameter | Type | Defaultvalue | Detail | Limitation |
---|---|---|---|---|
barWidth | int | 1 | widthofabar | 1D |
barHeight | int | 50 | containerheight | 1D |
moduleSize | int | 5 | largeur/hauteurd'unmodule | 2D |
showHRI | bool | true | displaytext(HRI:HumanreadableInterpretation) | |
bgColor | text | #FFFFFF | backgroundcolor | |
color | text | #000000 | barcodecolor | |
fontSize | int | 10 | fontsizeoftheHRI | |
output | text | css | outputtype:css,svg,bmp,canvas |
renderer:canvas | |||
---|---|---|---|
Parameter | Type | Defaultvalue | Detail |
posX | int | 0 | Xorigine |
posY | int | 0 | Yorigine |
相关文章推荐
- JQuery 遍历子元素+ each函数的跳出+提取字符串中的数字
- jquery attr和css属性
- jQuery入门:选择元素 Selecting Elements
- Jquery简单整理
- 『jQuery』.html(),.text()和.val()的使用
- jQuery选择器
- 深入学习理解jQuery中的extend方法以及JavaScript中对象的复制
- jquery获取所有选中的checkbox
- jquery返回顶部
- struts2+jquery+ajax的使用
- 10款基于jquery的web前端特效及源码下载
- jQuery切换所有复选框选中状态的方法
- jQuery移出style
- jQuery+toggle
- jQuery中的end()方法
- springMVC与jquery结合使用完整例子
- jquery遍历之children()与find()的区别
- jquery遍历table的tr获取td的值
- How to update jQuery Mobile in Dreamweaver CS6
- How to update jQuery Mobile in Dreamweaver CS6