มีปลั๊กอินสามตัวที่นี่คือ:
jQuery.js
Zeroclipboard.js
Zeroclipboard.swf
ขอให้โชคดี!
การคัดลอกรหัสมีดังนี้:
<meta charset = "utf-8" />
<button id = "d_clip_button" data-clipboard-target = "fe_text"> คลิกเพื่อคัดลอก </putton>
<อินพุต id = "fe_text" value = "ข้อความทดสอบ"
<script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </libs>
<script type = "text/javascript" src = "zeroclipboard.min.js"> </script>
<script type = "text/javascript">
$ (เอกสาร) .ready (function () {
Zeroclipboard.setDefaults ({
MoviePath: "Zeroclipboard.swf"
-
var clip = new Zeroclipboard ($ ("#d_clip_button"));
clip.on ("โหลด" ฟังก์ชั่น (ไคลเอนต์) {
console.log ("Zeroclipboard.");
client.on ("เสร็จสมบูรณ์", ฟังก์ชั่น (ไคลเอนต์, args) {
console.log ("เนื้อหาถูกคัดลอก:" + args.text);
-
-
-
</script>