版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hans201507/article/details/70168184
$(function() {
$("a[name='copy']").each(function(){
var url=$(this).attr("url");
var clip=null;
clip = new ZeroClipboard($(this));
clip.on("ready", function() {
clip.on("copy", function(event) {
alert("复制链接成功!"+url);
clip.setText(url);
});
});
clip.on("error", function(event) {
alert("复制失败,请重试");
ZeroClipboard.destroy();
});
})
})
$("a[name='copy']").each(function(){
var url=$(this).attr("url");
var clip=null;
clip = new ZeroClipboard($(this));
clip.on("ready", function() {
clip.on("copy", function(event) {
alert("复制链接成功!"+url);
clip.setText(url);
});
});
clip.on("error", function(event) {
alert("复制失败,请重试");
ZeroClipboard.destroy();
});
})
})