jquery Plugin: Cross-browser replication Jquery-zclip

Source: Internet
Author: User

Jquery-zclip is a jquery plugin that replicates content to the Clipboard, and we don't have to consider compatibility issues between different browsers and browser versions. Jquery-zclip plug-ins require Flash support and remember to install Adobe Flash Player when you use them.

1. Jquery-zclip Plug-in website
zeroclipboard.swf

2. Jquery-zclip usage

Introducing Jquery-zclip-related JS and SWF files
<script type= "Text/javascript" src= "<%=path%>/resources/js/jquery.min.js" ></script><script Type= "Text/javascript" src= "<%=path%>/resources/js/jquery.zclip.min.js" ></script><script type= "Text/javascript" >$ (function () { $ ("#cp-btn"). Zclip ({ path: ' <%=path%>/resources/js/ Zeroclipboard.swf ',//remember to introduce zeroclipboard.swf into the project copy:function () { return $ (' #inviteUrl '). Val (); } );}); </script><div class= "Form-row" > <div class= "col-md-5" > <input class= "Form-control" Value= "" id= "Inviteurl"/> </div> <div class= "col-md-1" > <a href= "Javascript:void ( 0) "id=" cp-btn " class=" btn btn-default btn-block Btn-clean "> Complex &nbsp;&nbsp; </a> </div ></div>

Configuration Instructions
path:swf path (replication mainly uses Flash to resolve different browser replication)
Copy: What you want to copy, either static or return dynamic content
Beforecopy: The function to be done before copying;
Aftercopy: function to be done after copying;

3 methods are available
Show:$ (selected). Zclip (' show ');//copy function valid
Hide:$ (selected). Zclip (' hide ');//Invalid copy function
Remove:$ (selected). Zclip (' remove ');//Completely remove the copy function

3. Demo Effect
After successful operation, click the Copy button, a prompt box will appear, indicating that the copy to the Clipboard takes effect, as follows:

Pop-up box appears "Copied Text to Clipboard" English characters, a bit inconsistent with the Chinese people use the habit, change it to "successfully copied to the Clipboard", in the Jquery.zclip.min.js file found "Copied text to clipboard" replaced by "Successfully copied to the Clipboard" is OK, the effect is as follows:

jquery Plugin: Cross-browser replication Jquery-zclip

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.