jquery 复制剪切板插件

01.$(document).ready(function(){02.03.    $('a#copy-description').zclip({04.        path:'js/ZeroClipboard.swf',05.        copy:$('p#description').text()06.    });07.08.    // The link with ID "copy-description" will copy09.    // the text of the paragraph with ID "description"10.11.12.    $('a#copy-dynamic').zclip({13.        path:'js/ZeroClipboard.swf',14.        copy:function(){return $('input#dynamic').val();}15.    });16.17.    // The link with ID "copy-dynamic" will copy the current value18.    // of a dynamically changing input with the ID "dynamic"19.20.});








01.$(document).ready(function(){02.03.    $("a#copy-callbacks").zclip({04.        path:'js/ZeroClipboard.swf',05.        copy:$('#callback-paragraph').text(),06.        beforeCopy:function(){07.            $('#callback-paragraph').css('background','yellow');08.            $(this).css('color','orange');09.        },10.        afterCopy:function(){11.            $('#callback-paragraph').css('background','green');12.            $(this).css('color','purple');13.            $(this).next('.check').show();14.        }15.    });16.17.});

你可能感兴趣的:(jquery)