Board logo

標題: [技術討論] copy 代碼 [打印本頁]

作者: mytempo    時間: 2017-3-9 23:16     標題: copy 代碼

[attach]1965813[/attach]

請問如果將一段野copy 的程式或開發應該係search 什麼謝謝?


http://www.photostore.me/image/sqNs

嵌入代碼 --> 之後按一下連結就可出現copy ,之後便自動識copy段網址
作者: Jackass_TMxCK    時間: 2017-3-10 08:14

js copy to clipboard
作者: hksfho    時間: 2017-3-29 18:17

  1. function copyTextToClipboard(text) {
  2.             var textArea = document.createElement("textarea");
  3.             textArea.style.position = 'fixed';
  4.             textArea.style.top = 0;
  5.             textArea.style.left = 0;
  6.             textArea.style.width = '2em';
  7.             textArea.style.height = '2em';
  8.             textArea.style.padding = 0;
  9.             textArea.style.border = 'none';
  10.             textArea.style.outline = 'none';
  11.             textArea.style.boxShadow = 'none';
  12.             textArea.style.background = 'transparent';
  13.             textArea.value = text;
  14.             document.body.appendChild(textArea);
  15.             textArea.select();
  16.             document.execCommand('copy');
  17.             document.body.removeChild(textArea);
  18.         }

  19.         copyTextToClipboard(url);
複製代碼

作者: hermanho    時間: 2017-4-6 04:51

https://github.com/zenorocha/clipboard.js





歡迎光臨 電腦領域 HKEPC Hardware (https://h2.hkepc.com/forum/) Powered by Discuz! 7.2