Javascript zeroclipboard版本2.1.1不可用
我正在尝试使用zeroclipboard 2.1.1 我添加了zeroclipboard.js和zeroclipboard.sw,但当我单击按钮时,没有任何内容变成复制。 但当我右击按钮时,flash player设置出现 有什么帮助吗Javascript zeroclipboard版本2.1.1不可用,javascript,jquery,zeroclipboard,Javascript,Jquery,Zeroclipboard,我正在尝试使用zeroclipboard 2.1.1 我添加了zeroclipboard.js和zeroclipboard.sw,但当我单击按钮时,没有任何内容变成复制。 但当我右击按钮时,flash player设置出现 有什么帮助吗 $(document).ready(function(){ var client = new ZeroClipboard(document.getElementById("Button2")); client.on("ready", function (re
$(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();
});
});
});
此警报警报(“零剪贴板SWF已准备就绪!”)代码>未显示
我已经添加了jQuery2.1,我刚刚解决了这个问题。。需要单击flash元素才能进行复制。对我来说,添加的元素与实际按钮的偏移量约为10像素,因此从未被单击过。使用css绝对定位在按钮上,它应该适合你!(数小时的沮丧?糟糕的文档!)
您还需要这样做才能添加电影,并确保包含Zeroclipboard.js
ZeroClipboard.config({
swfPath: moviepath,
forceHandCursor: true});