Language: JavaScript
Copy to Clipboard in JavaScript
function copyToClipboard(e) { $('#CodeDisplay').editable(); $('#_contenteditor') .focus() .select() .keydown(function(e) { // capture Ctl-C, Ctl-X, ESC to remove editable if (e.which == 99 || e.which == 120 || e.which == 27) { // have to delay so text doesn't go away before copy operation setTimeout( function() { $("#CodeDisplay").editable("cleanup") },500); } }); // show overlay message $("#divCopyDialog") .centerInClient({ container: $("#divContainerContent") }) .css("top", 350) .shadow() .closable() .draggable() .show() .fadeIn(1000); setTimeout(function() { $("#divCopyDialog").fadeOut(1000); }, 3000); };
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

