Last active
November 20, 2016 21:05
-
-
Save karlazz/901fc11689a645dc8f45305addd6854b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <div id="copy_initiator">Click me to Copy Text!</div> | |
| <script src="ZeroClipboard.min.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| var clip = new ZeroClipboard( document.getElementById("copy_initiator"), { | |
| moviePath: "ZeroClipboard.swf" | |
| } ); | |
| //this event happens upon initiating the copy | |
| clip.on( 'dataRequested', function ( client, args ) { | |
| clip.setText( "whatever text you want"); | |
| } ); | |
| //this event happens upon the copy finishing | |
| clip.on( 'complete', function(client, args) { | |
| alert("Copied text to clipboard: " + args.text ); | |
| } ); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment