加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

页面复制文本信息

发布时间:2020-12-15 17:28:53 所属栏目:百科 来源:网络整理
导读:!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"htmlheadmeta http-equiv="Content-Type" content="text/html; charset=UTF-8"/metatitle复制测试/titlescript type="text/javas
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<title>复制测试</title>
	<script type="text/javascript" src="ZeroClipboard.js"></script>
</head>
<body>
<span id="fe_text">天王盖地虎,宝塔镇河妖</span>
	<a style="color: #00a8e8;" href="javascript:;" id="d_clip_button" data-clipboard-target="fe_text">复制到剪切板</a>
	<span id="clip_ok" style="display: none; color:red; margin-left:8px;">复制成功</span>
<script type="text/javascript">
//定义一个新的复制对象
var clip = new ZeroClipboard( document.getElementById("d_clip_button"),{
  moviePath: "ZeroClipboard.swf"
} );

// 复制内容到剪贴板成功后的操作
clip.on( 'complete',function(client,args) {
	$("#clip_ok").show();
   //alert("复制成功,复制内容为:"+ args.text);
} ); 
</script>
</body>
</html>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读