http://jsfiddle.net/w4eL7/1/
它在我的例子中不起作用,因为我的复制处理程序copy id最初是隐藏的,而zClip有一个对隐藏元素的检查
if (o.is(':visible') && (typeof settings.copy == 'string' || $.isFunction(settings.copy)))所以我删除了它的o.is(':visible')检查,但它仍然不能工作,我的swf文件被放在正确的地方。
经过检查,我发现
clip.addEventListener('mouseDown', function (client) {
o.trigger('mousedown');
if(!$.isFunction(settings.copy)){
clip.setText(settings.copy);
} else {
clip.setText(o.triggerHandler('zClip_copy'));
}
if ($.isFunction(settings.beforeCopy)) {
o.trigger('zClip_beforeCopy');
}
});不能工作我的意思是addeventlistner中的任何东西都不能工作,有谁能告诉我解决方法,或者可以帮助我修复它
谢谢
发布于 2011-08-12 15:16:45
首先删除css-file中.rightMenu中的display: none;。它将被隐藏在移动到开头的zclip call之后。我做了一些更小的更改(也可以查看我的jsfiddle:http://jsfiddle.net/wV3H8/)。
$(document).ready(function() {
var selectedElement = null;
$("#copyChildDivId").zclip({
path: "swf/ZeroClipboard.swf",
copy: function() {
return (selectedElement !== null ? $(selectedElement).attr("id") : "");
},
afterCopy: function() {
$('#rightMenuItem').hide();
}
});
$('.rightMenu').hide();
$(".item").bind("contextmenu", function(e) {
$('#rightMenuItem').css({
top: e.pageY+'px',
left: e.pageX+'px'
}).show();
selectedElement = this;
return false;
});
});https://stackoverflow.com/questions/7036427
复制相似问题