1
我需要一種方法來從我的按鈕中刪除zclip,因爲它的動態加載,每次我加載它似乎添加zlip的另一個實例,因此複製多次。如何在複製到剪貼板後刪除zclip?
我試圖zclip(「刪除」)按照使用指南,但沒有運氣:「複製」
function zclipMe(){
$('#copySearch').zclip({
path: 'http://www.steamdev.com/zclip/js/ZeroClipboard.swf',
copy: function() {
return $(this).prev('.cvl0').text();
},
afterCopy: function(){
var theText = $(this).prev('.cvl0');
var thePosition = $(this).prev('.cvl0').position();
$('.copied').text('Copied!').fadeIn(150).delay(1200).fadeOut(200).css({'top': thePosition.top , 'left': thePosition.left , 'width': theText.width()+30 , 'height': theText.height()+30 , 'line-height': theText.height()+ 30 +'px'});
$(this).zclip('remove');
}
});
}
,你可以看到我覆蓋一個框的文本字被複制以顯示它已被成功複製,並且根據我的動態按鈕被加載的次數多次觸發。
謝謝