网页中添加打赏二维码


之前在某些博客中看到一个打赏功能,自己也想尝试一下。

参考:

https://github.com/greedying/tctip

博客园—打赏功能

博客园添加打赏功能

 

第一步:进入“我的博客”->“管理”->“设置”,往下拉,找到“博客侧边栏公告”后面,申请“JS”使用。

申请成功后显示为这样:

    

 

第二步,插入打赏功能代码。

greedying/tctip在TA的DEMO中已给出详细的代码

<!DOCTYPE html>
<html>
<head>
<title>赞助</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--<script type="text/javascript" src="http://static.tctip.com/tctip-1.0.2.js"></script>-->
<script type="text/javascript" src="http://raw.githack.com/greedying/tctip/master/dist/tctip-1.0.3.min.js"></script>
<script>
  new tctip({
    top: '20%',
    button: {
      id: 9,
      type: 'zanzhu'
    },
    list: [
      {
        type: 'alipay',
        qrImg: 'https://files.cnblogs.com/files/huanghongbo/zfb_sponser.bmp'
      }, {
        type: 'wechat',
        qrImg: 'https://files.cnblogs.com/files/huanghongbo/wx_sponser.bmp'
      }
    ]
  }).init()
</script>
</head>
<body>
</body>
</html>

备注:在参考文章中引用的js是比较老的版本了,最新可用版本为1.0.3。

 

最后,再次感谢https://github.com/greedying/tctip!!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM