1、申请开通cnblogs的JS代码支持
2、将微信收款码图片上传到cnblogs
3、将如下代码中的http://files.cnblogs.com/files/eritpang/weixin.bmp替换为刚刚上传的收款码图片的链接地址,然后将代码添加到设置->博客侧边栏公告(支持HTML代码)(支持JS代码)里面,再点击“保存”即可。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;" /> <title>打赏</title> <style type="text/css"> #dsSidebar { z-index: 999999; top: 18%; width: 200px; height: 200px; position: fixed; right: -200px; } #dsBtn { z-index: 999999; width: 30px; height: 58px; left: -30px; top: 80px; line-height: 28px; position: absolute; } .dsPanels { margin: 0px auto; overflow: hidden; } .dsPanel { float: left; margin: 0px 0px; padding: 12px 0px; text-align: center; background: #ffeedd; border-color: #ffeedd; border-radius: 8px; } .dsPanel-highlight { margin-top: 0; margin-bottom: 0; padding-left: 10px; padding-right: 10px; width: 160px; border: 8px solid #fd935c; } .dsPanel-button { display: block; font-size: 16px; font-weight: 500; color: #ffeedd; text-align: center; text-decoration: none; text-shadow: 0 1px rgba(black, .1); background: #fd935c; border-bottom: 2px solid #cf7e3b; border-color: rgba(black, .15); border-radius: 4px; } .dsPanel-title { width: 128px; margin: -15px auto 15px; padding-bottom: 0px; line-height: 22px; font-size: 14px; font-weight: bold; color: #ffeedd; text-shadow: 0 1px rgba(black, .05); background: #fd935c; border-radius: 0 0 4px 4px; } </style> <script> function moveBtn() { var dsBtn = document.getElementById("dsBtn"); var now = new Date(); var times = now.getTime(); var offsetSize = Math.sin(times / 380.0) * 15 + 45; var radius = Math.sin(times / 380.0) * 18 + 24; dsBtn.style.left = -offsetSize + 'px'; dsBtn.style.width = offsetSize + 'px'; dsBtn.style.borderRadius = radius + 'px'; setTimeout(moveBtn, 60); } var dsSidebarTimer = null; var dsSidebarOffsetRight = -200; function startMove(dsSidebarTarget, dsSidebarSpeed) { clearTimeout(dsSidebarTimer); function doMove() { var dsSidebar = document.getElementById('dsSidebar'); dsSidebarSpeed *= 0.9; if (dsSidebarSpeed > -1 && dsSidebarSpeed < 0) { dsSidebarSpeed = -1; } else if (dsSidebarSpeed < 1 && dsSidebarSpeed > 0) { dsSidebarSpeed = 1; } dsSidebarOffsetRight = dsSidebarOffsetRight + dsSidebarSpeed; if (dsSidebarSpeed > 0 && dsSidebarOffsetRight >= dsSidebarTarget) { dsSidebarOffsetRight = dsSidebarTarget; dsSidebar.style.right = dsSidebarOffsetRight + 'px'; } else if (dsSidebarSpeed < 0 && dsSidebarOffsetRight <= dsSidebarTarget) { dsSidebarOffsetRight = dsSidebarTarget; dsSidebar.style.right = dsSidebarOffsetRight + 'px'; } else { dsSidebar.style.right = dsSidebarOffsetRight + 'px'; dsSidebarTimer = setTimeout(doMove, 30); } } doMove(); } document.getElementById('dsImg').onload = function () { var dsSidebar = document.getElementById('dsSidebar'); dsSidebar.onmouseover = function () { startMove(0, 24); } dsSidebar.onmouseout = function () { startMove(-200, -24); } moveBtn(); } </script> </head> <body> <div id="dsSidebar"> <div class="dsPanels"> <div class="dsPanel dsPanel-highlight"> <p class="dsPanel-title">喜欢请用微信打赏</p> <img id='dsImg' src="/UploadFiles/2021-04-02/weixin.bmp">4、效果如下。
以上这篇自制简易打赏功能的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年09月30日
2024年09月30日
- 纪钧瀚《钢琴阅读时光 雨中书店聆听轻音乐》[FLAC/分轨][399.62MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[320K/MP3][87.4MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[FLAC/分轨][184.94MB]
- 陈慧娴.2018-Priscilla-Ism演唱会3CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 郑秀文.1999-我应该得到(国)【华纳】【WAV+CUE】
- 陈家慧.2011-钢琴酒吧2CD【龙吟唱片】【WAV+CUE】
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[320K/MP3][45.01MB]
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[FLAC/分轨][109.13MB]
- 赞多《序章》[320K/MP3][45.54MB]
- 许巍.2004-每一刻都是崭新的【步升大风】【WAV+CUE】
- 群星.2024-四方馆影视原声带【韶愔音乐】【FLAC分轨】
- 陈雷.1997-安锁咧【金圆唱片】【WAV+CUE】
- 关淑怡.2013-MY.FAVORITE.SK.3CD【环球】【WAV+CUE】
- Sweety.2006-花言乔语【丰华】【WAV+CUE】
- 李恕权.2003-回·20年全精选2CD【SONY】【WAV+CUE】