点击复制链接

HTML:
<a href="javascript:void(0)" data-clipboard-text="http://midaijihua.com" class="copy">邀请好友</a>
JS:
if ($('.copy').length) {
var client = new ZeroClipboard(
$('.copy'),
{moviePath: '/static/themes/plan/yangjing/js/ZeroClipboard.swf'}
);

client.on('complete', function (client, args) {
alert("复制成功: " + args.text);
});
} else {
window.location.reload();
}
posted @ 2016-11-08 15:17  暖爱  阅读(6817)  评论(0编辑  收藏  举报