H5生成二维码

1.html2canvas.js(点我下载。提取码:d0t5)javascript

<script type="text/javascript">
html2canvas($(".qrcode")[0], {
    onrendered: function(canvas) {
        $(".qrcode").html(canvas);
    }
});
</script>

2.jq.qrcode.logo.jshtml

<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.固定的内容,能够本身直接制做,网站连接java

相关文章
相关标签/搜索