This article describes how to use the Jquery cross-browser text replication plug-in ZeroClipboard. If you need a friend, you can refer to the following when the developer needs to click to copy a certain part of the text, implementation in IE is relatively simple. However, it is difficult to achieve cross-browser. Zero Clipboard, which uses Flash for copying, can be run only when Flash is installed in the browser, and is more flexible than document.exe cCommand ("Copy") of ie.
Implementation principle of Zero Clipboard
Zero Clipboard uses Flash for copying. Previously there was a Clipboard Copy solution, which used a hidden Flash. However, the latest Flash Player 10 allows you to start the clipboard only by performing operations on the Flash. Therefore, Zero Clipboard has been improved, and a transparent Flash is used to float the button. In this way, the Flash copy function can be used instead of the button but Flash.
Zero Clipboard features:
Compatible with Flash 10
Avoid using third-party browser plug-ins (security Conflicts in Adobe Flash browsers)
Invisible coverage, no interference, page design
Supports CSS "hover" and "active" statuses
Retain the "click", "mouseenter", and "mouseleave" events of the target element.
Supply callback functions "before replication" and "copy"
Very light! (7 kb reduction)
Download the Zero Clipboard and decompress it. Two files are required: ZeroClipboard. js and ZeroClipboard.swf. Put these two files into your project.
Click to download: jquery. zclip.1.1.1
Usage:
First, introduce the core file.
The Code is as follows: