여기에는 세 가지 플러그인이 필요합니다.
jQuery.js
Zeroclipboard.js
Zeroclipboard.swf
행운을 빌어요!
코드 사본은 다음과 같습니다.
<meta charset = "utf-8" />
<button id = "d_clip_button"data-clipboard-target = "fe_text"> 복사하려면 클릭하십시오
<input id = "fe_text"value = "테스트 텍스트."
<script type = "text/javaScript"src = "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script>
<script type = "text/javaScript"src = "zeroclipboard.min.js"> </script>
<script type = "text/javaScript">
$ (document) .ready (function () {
zeroclipboard.setDefaults ({
Moviepath : "Zeroclipboard.swf"
});
var clip = new Zeroclipboard ($ ( "#d_clip_button");
clip.on ( "로드", 함수 (클라이언트) {
Console.log ( "Zeroclipboard.");
client.on ( "완료", function (client, args) {
Console.log ( "콘텐츠가 복사되었습니다 :" + args.text);
});
});
});
</스크립트>