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

参考:

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!!

相关文章:

  • 2021-07-23
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2022-01-28
  • 2021-10-31
猜你喜欢
  • 2021-07-14
  • 2021-06-13
  • 2021-06-15
  • 2021-08-14
  • 2021-06-25
相关资源
相似解决方案