The JQuery Zclip plug-in implements Cross-browser replication functionality _jquery

Source: Internet
Author: User

Jquery-zclip is a jquery plug-in that copies content to the Clipboard, and uses it without considering compatibility issues between different browsers and browser versions. The Jquery-zclip plugin requires Flash support and is used to remember to install Adobe Flash Player.

1. Jquery-zclip usage

//introduce Jquery-zclip related JS and swf file <script type= "Text/javascript" src= 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 () {Retu
    RN $ (' #inviteUrl '). Val ();
}
  });
}); </script> <div class=form-row> <div class=col-md-5> <input class=form-control value= "id=" INV Iteurl "/> </div> <div class=col-md-1> <a href=" javascript:void (0) "id=" cp-btn "class=" btn Btn-default btn-block Btn-clean ">    system </a> </div> </div> 

Configuration Instructions
Path :swf paths (replication is primarily in Flash to solve different browser replication)
copy: content to be copied, can be static content, also can return dynamic content
beforecopy: The function to be done before copying;
aftercopy: function to be done after the copy;

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

2. Demo Effect
After successful operation, click the Copy button, will pop up a prompt box, indicating that the copy to the Clipboard effective, as follows:

Pop-up box appears "Copied Text to Clipboard" English characters, a bit inconsistent with the habits of the Chinese people to change it to "successfully copied to the Clipboard", found in the jquery.zclip.min.js file "Copied text to Clipboard "Replace with" successfully copied to the Clipboard is OK, the effect is as follows:

The above is a small collation of the jquery Zclip plug-ins to achieve a cross-browser copy of the full content of the function, I hope to help you learn.

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.