我正在尝试使用zeroclipboard 2.1.1
我添加了zeroclipboard.js和zeroclipboard.sw,但当我单击按钮时,什么也没有复制。不过,当我右击该按钮时,flash player设置就会出现。
有什么帮助吗?
$(document).ready(function(){
var client = new ZeroClipboard(document.getElementById("Button2"));
client.on("ready", function (readyEvent) {
alert( "ZeroClipboard SWF is ready!" );
client.on("aftercopy", function (event) {
// `this` === `client`
// `event.target` === the element that was clicked
//event.target.disabled = true;
//alert("Copied text to clipboard: " + event.data["text/plain"]);
});
client.on('error', function (event) {
console.log( 'ZeroClipboard error of type "' + event.name + '": ' + event.message );
ZeroClipboard.destroy();
});
});
});此警报alert( "ZeroClipboard SWF is ready!" );未显示
我已经添加了jquery 2.1
发布于 2014-06-27 23:49:43
我刚想通了..。需要单击flash元素才能进行复制。对于我来说,这个元素被添加到离我的实际按钮大约10个像素的位置,因此从未被点击过。使用css将其绝对放置在按钮上,它应该可以为您工作!(几个小时的挫折感?糟糕的文档!)
您还需要执行此操作来添加电影,并确保包含您的Zeroclipboard.js
ZeroClipboard.config({
swfPath: moviepath,
forceHandCursor: true});https://stackoverflow.com/questions/24416741
复制相似问题