kuangxin

需要插件

ZeroClipboard.min.js

ZeroClipboard.swf

 

页面代码

<script src="/Js/ZeroClipboard/ZeroClipboard.min.js"></script>
<h2>
Index</h2>
<input type="button" id="d_clip_button" data-clipboard-target="fe_text" value="复制" />
<input type="hidden" id="fe_text" value="www.baidu.com">
<script>
$(function () {
var clip = new ZeroClipboard(document.getElementById("d_clip_button"), {
moviePath: "/Js/ZeroClipboard/ZeroClipboard.swf"
});
clip.on(\'complete\', function (client, args) {
alert("复制成功,复制内容为:" + args.text);
});
});
</script>

 

 

效果

 

 

分类:

技术点:

相关文章:

  • 2021-12-05
  • 2021-09-03
  • 2021-12-27
  • 2021-12-05
  • 2021-07-23
  • 2021-11-21
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2021-11-04
  • 2022-12-23
  • 2021-11-19
  • 2021-12-20
  • 2021-12-25
相关资源
相似解决方案