zeroclipboard无效版本2.1.1

时间:2014-06-25 19:14:17

标签: javascript jquery zeroclipboard

我正在尝试使用zeroclipboard 2.1.1

我添加了zeroclipboard.js和zeroclipboard.sw,但是当我点击按钮时,没有任何东西变成副本。 虽然当我右键单击按钮时,会出现Flash播放器设置。

任何帮助?

$(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

1 个答案:

答案 0 :(得分:0)

我只是想出来..需要点击flash元素才能复制。对我来说,元素被添加了大约10个像素偏离我的实际按钮,因此从未被点击。使用css绝对将它放在按钮上,它应该适合你! (这个令人沮丧的时间?可怕的文件!)

您还需要这样做才能添加电影,并确保包含Zeroclipboard.js

              ZeroClipboard.config({ 
              swfPath: moviepath,
              forceHandCursor: true});