B1 add script
<script src="ZeroClipboard.js"></script>b2: html tương ứng
<script>
$(document).ready(function() {
var clip = new ZeroClipboard($('.zc_class'), {
moviePath: "zeroclipboard.swf"
});
clip.on('mousedown', function(client, args) {
switch(this.id) {
case 'copy-button1':
var codeht=$('#codeHTML').val();
clip.setText(codeht);
break;
case 'copy-button2':
var codeht=$('#codeBB').val();
clip.setText(codeht);
break;
case 'copy-button3':
var codeht=$('#codeDirect').val();
clip.setText(codeht);
break;
}
});
clip.on("load", function(client) {
alert("movie is loaded");
});
clip.on("complete", function(client, args) {
alert("Copied text to clipboard: " + args.text);
});
});
</script>
<input style="font-size: 12px;" id="codeHTML" class="codeht" type="text" />B3: download zeroclipbroad tại trang chủ hay tại đây với code trên dùng phiên bản zero clipbroad 1.35
<button id="copy-button1" class="zc_class" > Copy To ClipBoard 1 </button>
<br>
<font color="Deepskyblue" size="2"><b>Dán Vào Forum</b></font>
<input style="font-size: 12px;" id="codeBB" value="" type="text" />
<button id="copy-button2" class="zc_class" > Copy To ClipBoard 2</button>
<br>
<font color="green" size="2"><b>Link Trực Tiếp </b></font>
<input style="font-size: 12px;" id="codeDirect" value="" type="text" />
<button id="copy-button3" class="zc_class"> Copy To ClipBoard 3</button>
No comments: