H5生成二维码
1.html2canvas.js(点我下载。提取码:d0t5)
<script type="text/javascript"> html2canvas($(".qrcode")[0], { onrendered: function(canvas) { $(".qrcode").html(canvas); } }); </script>
2.jq.qrcode.logo.js
<script type="text/javascript">
function createQRCode(id, url, width, height, src){
$('#'+id).empty();
jQuery('#'+id).qrcode({
render: 'canvas',
text: url,
width : width, //二维码的宽度
height : height, //二维码的高度
imgWidth : width/4, //图片宽
imgHeight : height/4, //图片高
src: src //图片中央的二维码
});
}
function init() {
createQRCode("code", "测试", $("#code").width(),
$("#code").height(), "img/logo.png");
}
init()
</script>
3.固定的内容,可以自己直接制作,网站链接

浙公网安备 33010602011771号