使用jquery.qrcode.js生成二维码-支持中英文混合输入
官网:https://larsjung.de/jquery-qrcode/
github:https://github.com/lrsjng/jquery-qrcode
演示:https://larsjung.de/jquery-qrcode/latest/demo/
<div id="qrcodeTable"></div> <img id="logoimg" src="logo.png"> <script> $('#qrcodeTable').qrcode({ // render method: 'canvas', 'image' or 'div' render: 'image', // version range somewhere in 1 .. 40 minVersion: 1, maxVersion: 40, // error correction level: 'L', 'M', 'Q' or 'H' ecLevel: 'L', // offset in pixel if drawn onto existing canvas left: 0, top: 0, // size in pixel size: 200, //二维码尺寸 // code color or image element fill: '#000', //二维码颜色 // background color or image element, null for transparent background background: '#fff', //背景色 // content text: '汉a字', // corner radius relative to module width: 0.0 .. 0.5 radius: 0, // quiet zone in modules quiet: 2, //可理解为css的padding,大小为quiet*6像素 // modes // 0: normal 无文字、无logo // 1: label strip // 2: label box 显示文字 // 3: image strip // 4: image box 显示logo mode: 4, mSize: 0.1, //logo尺寸 mPosX: 0.5, //logo位置 mPosY: 0.5, label: 'hello', //使用文字代替logo fontname: 'sans', fontcolor: '#000', image: null, //$('#logoimg')[0] }); </script>
<script> $('#qrcodeTable').qrcode({ render: 'image', //canvas|image|div size: 200, //二维码尺寸 text: '汉a字', quiet: 2, //可理解为css的padding,大小为quiet*6像素 }); </script>
回应(1):