<div class="iddv" style="font-size: 12px;color: #333;position: absolute;bottom: 90px;width: 100%;"><div class="dv_top" style="font-size: 10px;width: 100%;box-sizing: border-box;color: #999;margin-bottom: 5px;">可通过共读训练里的“训练营广场”页面搜索ID,找到训练营</div><span>训练营ID:</span><span id="id_num">${obj.action.id}</span><span class="copyId" style="margin-left: 15px;font-weight: 500;">复制</span><input class="inp" style="display: none" type="button" onClick="copyUrl2()" value="点击复制代码" /></div><div class="copy_suc" style="position: absolute;bottom: 110px;background: rgba(0, 0, 0, .43);padding: 5px 17px;font-size: 16px;color: #fff;border-radius: 10px;left: 50%;transform: translateX(-50%);display: none">复制成功</div>
// 复制function copyUrl2() {var Url2 = document.getElementById("id_num").innerText;// 要被复制的文本内容var oInput = document.createElement('input');oInput.value = Url2;document.body.appendChild(oInput);oInput.select(); // 选择对象document.execCommand("Copy"); // 执行浏览器复制命令oInput.className = 'oInput';oInput.style.display = 'none';document.body.removeChild(oInput);// alert('复制成功');// 复制成功之后的弹框(显示几秒)$(".copy_suc").show()setTimeout(function () {$(".copy_suc").hide()},1500)}// 点击复制触发复制文本$(".copyId").click(function () {$(".inp").click()})
