【问题标题】:how to remove zclip after its copied to clipboard?复制到剪贴板后如何删除zclip?
【发布时间】:2014-07-03 17:54:29
【问题描述】:

我需要一种方法来从我的按钮中删除 zclip,因为它是动态加载的,并且每次加载它似乎都会添加另一个 zlip 实例,因此会复制多次。

我按照使用指南尝试了 zclip('remove') 但没有运气:

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');
       }
    });
}

如您所见,我在要复制的文本上覆盖了一个框,并带有“已复制!”一词显示它已被成功复制,并且这会根据我的动态按钮已加载的次数而触发多次。

谢谢

【问题讨论】:

    标签: jquery zclip


    【解决方案1】:

    我也有同样的问题。 我解决了删除事件 尝试 第一个: $('#copySearch').unbind(); 如果您需要再次生成按钮

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-27
      相关资源
      最近更新 更多