分享一款子比主题独立下载页面美化!

直接下载文件覆盖掉download.php即可(文件路径:/wp-content/themes/zibll/pages/download.php),更新前记得备份!记得备份!记得备份!不然就没后悔药吃了!
JS代码
<!--下载页面密码复制-->
if(document.querySelectorAll(".but-download .badg")!=undefined){
const reg = /[a-zA-z0-9]/ig;
const copy = document.querySelectorAll(".but-download .badg");
for (let i = 0; i < copy.length; i++) {
copy[i].index = i;
copy[i].setAttribute("data-toggle", "tooltip");
copy[i].setAttribute("data-original-title", "点击复制");
copy[i].addEventListener("click", copyOperation);
};
function copyOperation() {
var oInput = document.createElement("input");
let text = this.innerText;
text = text.match(reg).join("");
oInput.value = text;
document.body.appendChild(oInput);
oInput.select();
document.execCommand("Copy");
oInput.className = "oInput";
oInput.style.display = "none";
this.setAttribute("data-original-title", "已复制");
};
};
这里再套个点击复制密码功能吧!
下载地址
免责声明:
本站资源部分来自网友投稿,如有侵犯你的权益请联系管理员或给邮箱发送邮件aliciabarnet6@gmail.com 我们会第一时间进行审核删除。
站内资源为网友个人学习或测试研究使用,未经原版权作者许可,禁止用于任何商业途径!请在下载24小时内删除!
如果遇到评论可下载的文章,评论后刷新页面点击“对应的蓝字按钮”即可跳转到下载页面!
本站资源少部分采用7z压缩,为防止有人压缩软件不支持7z格式,7z解压,建议下载7-zip,zip、rar解压,建议下载WinRAR。