jquery-zclip插件完成页面复制粘贴

下载地址 https://github.com/patricklodder/jquery-zclip.git

  1. <script src="jquery-1.9.1.js"></script>  
  2. <script src="jquery-zclip-master/jquery.zclip.js"></script>  
  3. <button id="copy">copy</button>  
  4. <input id="content"/>  
  5. <script>  
  6.   
  7. $(function(){  
  8.     $('#copy').zclip({  
  9.         path'jquery-zclip-master/ZeroClipboard.swf',  
  10.         copy: function(){//复制内容  
  11.             return $('#content').val();  
  12.         },  
  13.         afterCopy: function(){//复制成功  
  14.             alert("复制成功")  
  15.         }  
  16.     });  
  17. });  
  18. </script>