Zeroclipboardjs+flash implementation to copy content to the Clipboard instance

Source: Internet
Author: User

The realization principle of Zeroclipboard
Zeroclipboard uses Flash for replication, previously with the Clipboard copy solution, which exploits a hidden flash. However, the latest Flash Player 10 only allows operation on Flash to start the Clipboard. So the Zero Clipboard to improve this, with a transparent flash, let it float on the button above, so in fact, the click is not the button but flash, you can use the copy function of Flash.

How to use Zeroclipboard
First download the Zeroclipboard and unzip it. It requires two files: Zeroclipboard.js and zeroclipboard.swf, and put these two files into your project.

Second, the effect can only be seen on the server, so you can create a virtual project in your PC's IIS.

The effect is as follows:

Words not much to say, directly on the code:

Reference:

<script src= "Jquery.min.js" ></script><script src= "jquery. Zeroclipboard.js "></script>

HTML Code:

 <  input  type  = "text"   ID  = "TXT"   class  = "TXT"  />  <  input  type  = "button"   = "click Copy"   ID  = "Copy"   class  = "Copy"   Data-clipboard-target  = "TXT"  />  

JS Code:

<Script>$(function(){    //Copy URL    varClip= NewZeroclipboard (document.getElementById ("Copy"), {moviepath:"zeroclipboard.swf"    }); //Replication succeededClip.on (' Complete', function(client, args) {//Args.textAlert ("has been copied to the Clipboard");    }); })</Script>

Click Download Zeroclipboardjs+flash to copy content to clipboard instance Demo

Zeroclipboardjs+flash implementation to copy content to the Clipboard instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.