zoukankan      html  css  js  c++  java
  • 将url动态转换成二维码插件

    插件地址  http://static.runoob.com/assets/qrcode/qrcode.min.js ,网页直接打开,然后ctrl+s保存到本地。

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
        </head>
        <body>
            <button id="btn">分享</button>
            <div id="qrcode" style="display: none;"></div>
            <script src="jquery.min.js"></script>
            <script src="qrcode.min.js"></script>
            <script>
                 var qrcode = new QRCode(document.getElementById("qrcode"), {
                    width : 200,
                    height : 200
                });
                var urlPath = window.location.href;
                qrcode.makeCode(urlPath);
                $("#btn").mouseover(function(){
                    $('#qrcode').show();
                }).mouseout(function(){
                    $('#qrcode').hide();
                })
                
            </script>
        </body>
    </html>

    效果截图:

  • 相关阅读:
    其他
    Win10
    Win10
    面向对象与设计模式
    Git
    Java
    Git
    Git
    Git
    一、I/O操作(File文件对象)
  • 原文地址:https://www.cnblogs.com/stella1024/p/9172132.html
Copyright © 2011-2022 走看看