jQuery插件jquery-barcode实现条码打印的方法
作者:bea
本文实例讲述了jQuery插件jquery-barcode实现条码打印的方法。分享给大家供大家参考,具体如下: 这是一个纯js的jQuery插件,项目地址:http://barcode-coder.com/en/barcode-jquery-plugin-201.html 使用示例: <!doctype html><html> <head> <title>jQuery Barcode</title> <
本文实例讲述了jQuery插件jquery-barcode实现条码打印的方法。分享给大家供大家参考,具体如下:
这是一个纯js的jQuery插件,项目地址: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>
运行效果截图如下:
完整实例代码代码点击此处本站下载。
希望本文所述对大家jQuery程序设计有所帮助。
有用 | 无用
这是一个纯js的jQuery插件,项目地址: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>
运行效果截图如下:
完整实例代码代码点击此处本站下载。
希望本文所述对大家jQuery程序设计有所帮助。
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- Jquery中request和request.form和request.querystring的区别
- Jquery检验手机号是否符合规则并根据手机号检测结果将提交按钮设为不同状态
- JS延时提示框实现方法详解
- js使用cookie记录用户名的方法
- Bootstrap每天必学之导航
- js过滤HTML标签完整实例
- 使用EVAL处理jqchart jquery 折线图返回数据无效的解决办法
- JAVASCRIPT代码编写俄罗斯方块网页版
- Bootstrap每天必学之按钮
- 学习JavaScript设计模式(多态)
- 创建自己的jquery表格插件
- 一不小心就做错的JS闭包面试题
- javascript Slip.js实现整屏滑动的手机网页
- javascript巧用eval函数组装表单输入项为json对象的方法
- javascript数据结构之双链表插入排序实例详解
- js获取图片宽高的方法
- javascript数据结构之二叉搜索树实现方法
- javascript常用经典算法实例详解
- javascript实现很浪漫的气泡冒出特效