码迷,mamicode.com
首页 > Web开发 > 详细

jquery生成二维码

时间:2016-08-12 18:06:26      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>二维码</title>
</head>
<style>
    #qrcode{
        position: relative;
        width: 400px;
        height: 400px;
        margin: 0 auto;
    }
    .logo{
        position: absolute;
        width: 100px;
        margin: auto;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        height: 37px;
        z-index: 222;
    }
    .logo img{
        width: 100px;
    }
</style>
<body>
    


<div id="qrcode">
    <div class="logo">
        <img src="1.jpg" alt="">
    </div>
</div>
</body>
<script type=‘text/javascript‘ src=‘http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js‘></script>
<script type="text/javascript" src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<script>
$(function(){
    //$(‘#qrcode‘).qrcode("http://pmi.yoopay.cn/");
    // 更详细的配置
         $(#qrcode).qrcode({
            text: "http://pmi.yoopay.cn/", // 要编码的字符串
            width: 400, // 定义宽度
             height: 400, // 定义高度
             background: "#fff", // 背景色
            foreground: "black" // 前景色
       // qrcode.clear(); // 清除二维码
}); }) </script> </html>

技术分享

jquery生成二维码

标签:

原文地址:http://www.cnblogs.com/mymission/p/5765874.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!