js生成条形码插件
<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>js生成条形码插件</title>
<script src="https://cdn.bootcss.com/jsbarcode/3.8.0/JsBarcode.all.min.js"></script>
<style>
* {margin: 0;padding: 0;box-sizing: border-box;}
h3 {text-align: center;font-size: 16px;margin: 10px;}
.box {text-align: center;}
#barcode {width: 200px;}
ul {padding: 5px;}
li {list-style: none;padding: 5px 10px;font-size: 14px;line-height: 18px;}
pre {font-size: 12px;}
</style>
</head> <body>
<h3>js自动生成条形码插件-JsBarcode</h3>
<div class="box">
<img id="barcode" />
</div>
<ul>
<li>npm官网地址:https://www.npmjs.com/package/jsbarcode</li>
<li>github:https://github.com/lindell/JsBarcode</li>
<li>使用说明:</li>
<li>引入JsBarcode插件:JsBarcode.all.min.js</li>
<li>可以访问:http://www.bootcdn.cn/jsbarcode/</li>
<li>在HTML中放置img标签存放条形码的容器</li>
<li>默认配置项</li>
<li>
<pre>
{
width: 2,//较细处条形码的宽度
height: 100, //条形码的宽度,无高度直接设置项,由位数决定
//也可以通过CSS去调整
quite: 10,
format: "CODE128",
displayValue: false,//是否在条形码下方显示文字
font:"monospace",
textAlign:"center",
fontSize: 12,
background:"",
lineColor:"#000"//条形码颜色
}
</pre>
</li>
</ul>
</body>
<script>
var barcode = document.getElementById('barcode'),
str = "18612908099",
options = {
format: "CODE128",
displayValue: true,
fontSize: 18,
height: 100
};
JsBarcode(barcode, str, options); //原生
// $('#barcode').JsBarcode(string, options); //jQuery
</script> </html>
js生成条形码插件的更多相关文章
- js自动生成条形码插件-JsBarcode
JsBarcode.html <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...
- 使用js生成条形码以及二维码
一.用js生成条形码这种业务场景不是很常见的,最近刚好又接到这种需求 Google一下,发现github还真有这方面的轮子,感谢github,省去了我们很多造轮子的过程, 好了言归正传,首先引入jsb ...
- 生成条形码插件 条形码--JsBarcode
每天学习一点点 编程PDF电子书免费下载: http://www.shitanlife.com/code 介绍一下在GitHub生成条形码的js插件→JsBarcode 条码支持的有: CODE128 ...
- js生成条形码——JsBarcode
原文地址:https://www.cnblogs.com/huangenai/p/6347607.html 介绍一下在GitHub生成条形码的js插件→JsBarcode 条码支持的有: CODE12 ...
- js生成条形码
生成条形码 <body> <div> <img id="ma"/> </div> </body> </html&g ...
- Barcode.js功能强大的条码生成jQuery插件
本文转载自http://www.uedsc.com/barcode-js.html Barcode.js是一个基于jQuery库的插件,用于绘制条形码或者二维码,能够生成基于DIV+CSS或者Canv ...
- 使用js生成二维码和条形码
1.生成二维码 使用github开源项目qrcode. 1.引入方式一(js cdn引入): ①.引入qrcode cdn: 自行下载..没有合适的cdn,地址 <script src=&quo ...
- js插件---在线类似excel生成图表插件解决方案
js插件---在线类似excel生成图表插件解决方案 一.总结 一句话总结:google比百度好用多了,多用google google js editable table jquery 双向绑定 这种 ...
- 前端如何生成条形码---JsBarcode
React 生成条形码代码 注:需引入 jsbarcode 插件 import React from 'react'; import JsBarcode from 'jsbarcode'; class ...
随机推荐
- TOJ3112: 单词串串烧(回溯)
传送门(<--可以点击的) 时间限制(普通/Java):1000MS/3000MS 内存限制:65536KByte 描述 “单词串串烧”是一款拼词智力游戏,给定4*4的方格,随机取16个 ...
- 199. Binary Tree Right Side View (Tree, Stack)
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nod ...
- java常量类编译问题
常量类编译后并不在.class文件中呈现,取而代之的是各个具体的常量.例如: 编译前:(Constant.OPTIONSRADIO常量值为1) 编译后: 应用场景 1,项目编译后发布项目前可以删除常量 ...
- 【Linux系列】Ubuntu ping通,xshell无法连接
现象描述:Ubuntu能Ping通主机,主机也能ping通虚拟机.而且,虚拟机也能上网.只是xshell不能连接. 解决方案: 一:使用管理员身份 设置防火墙. 先查看一下防火墙状态 sudo ufw ...
- C# 关闭进程的时候总是捕捉到System.Threading.ThreadAbortException: 正在中止线程
C# 关闭进程的时候总是捕捉到System.Threading.ThreadAbortException: 正在中止线程 这是由ThreadAbortException抛出的 可以写成下面的样子 tr ...
- Github上Markdown基本语法
基础写作和语法格式 本篇文章的内容来源于Github的基础写作帮助.如果在观看时有什么问题,可以直接查阅源文件.另外需要说明的是Git对Markdown的支持增加了一些扩展功能,因此在Git上可以渲染 ...
- istream_iterator和ostream_iterator
总结: istream_iterator<T>in(strm);T指明此istream_iterator的输入类型,strm为istream_iterator指向的流 提供了输入操作符(& ...
- Oracle的SQL语句中如何处理‘&’符号
‘&’符号在SQL中有特殊含义,所以在SQL中想要写入&,需要特殊处理. 如下SQL语句就不能正确运行: SQL> select 'a&b' from dual; 处理方 ...
- yum 安装 php7 ,lamp ,以及安装swoole
1 更新yum yum update 2 安装依赖 yum -y install pcre* openssl* yum -y install gcc make gd-devel libjpeg-dev ...
- (转帖)CentOS最常用命令及快捷键整理
原文:http://www.centoscn.com/CentOS/help/2014/0306/2493.html 最近开始学Linux,在VMware Player中安装了CentOS 6.4.为 ...