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.