jQuery Clipboard plugin: copy any text to the user's clipboard. Implements ZeroClipboard over the jQuery plugin layer.
- Due to Flash restrictions, jQuery Clipboard cannot be used on local domains (localhost, .dev), you need to serve it from a genuine Internet domain (.com, .net or so)
- Please check that you are using at least jQuery 1.7 - jQuery Clipboard won't work with versions below!
<script type="text/javascript" src="/path/to/javascripts/jquery.js"></script>
<script type="text/javascript" src="/path/to/javascripts/jquery.clipboard.js"></script>
$(document).ready(function() {
var copy_sel = $('.code-block a.code-copy');
// Disables other default handlers on click (avoid issues)
copy_sel.on('click', function(e) {
e.preventDefault();
});
// Apply clipboard click event
copy_sel.clipboard({
path: '/path/to/flashes/jquery.clipboard.swf',
copy: function() {
var this_sel = $(this);
// Hide "Copy" and show "Copied, copy again?" message in link
this_sel.find('.code-copy-first').hide();
this_sel.find('.code-copy-done').show();
// Return text in closest element (useful when you have multiple boxes that can be copied)
return this_sel.closest('.code-block').text();
}
});
});
More docs can be found on http://www.steamdev.com/zclip/
jQuery Clipboard is mostly based on jQuery.zClip, the plugin APIs remain almost the same.
jquery.clipboard's People
Forkers
antsfee robly vastra pratibha31 webspirit hantep raphael-drion pix wooichamp7 steppek emkorybski miguelslo27 wearecodeli pythonicninja kavun mmahalwy mbautista andrewcorbin vidyadhar21 dawar-khan wigurenko ottscho imanfakhar dmmsoft wp1stop sharasai dulumao anythingc0de vadim8 nhuanvn liulu081227 crmmvio pressreader palaniappan-sevugarathinam killvxkjquery.clipboard's Issues
hello the plugin is awesum but i am trying to implement it in apex tool, in a page table with records will be generated,every cilumn will be having a image, on click of that image the data in the field must be copied say as id number with respective to its column only is this posible with this code?
May I know how to update the ZeroClipboard you are using to the latest version?
Thanks for your plugin. However, they are update quite frequently. Can I just overwrite the zeroClipboard Portion?
Not Working For Dynamically Added Elements
hide the "copy"-button when flash not available?
is this possible?
Additional clipboard buttons with AJAX content
Does jquery.clipboard allow for additional clipboard buttons to be added to content added via ajax?
Click Twice To Copy
Seems that some users are encountering issues with copying, requiring them to click twice on the link to get the text copied.
This is abnormal, needs a fix.
Clipboards are stacking
Hello, great plugin!
But I have a problem.
I have three buttons that launch clipboard A, B and C.
After click on A - nothing copied.
After click on B - copied text that was targeted for A button.
And If I click A button twice - it copied right.
It stacking results somehow. The selectors are right and checked by console inside "copy: function() {}", but returned values (copied text) are late.
Have you seen this behavior before?
Thanks!
Plugin not intialize with dynamic data
Condition o.is(':visible') in line 35 not works with ajax html? Is this condition required?
Thanks for plugin!
Set clipboard for hidden element
My all copy buttons on page are hidden with display:none. And it seems that copy_sel.clipboard() call doesn't have effect on hidden buttons.
Anyway to fix that issue? Thanks
Multiple Elements
Restore the original, deprecated, zclip's ability to be applied on multiple elements.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.