How to Use the Jquery cross-browser text replication plug-in ZeroClipboard _ jquery

Source: Internet
Author: User
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:

  1. First, introduce the core file.

The Code is as follows:

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.