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.固定的內容,可以自己直接制作,網站鏈接


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM