Sometimes it's hard to collect all the fragments and work ... this is a complete solution using ZeroClipboard 1.3.2 and Bootstrap 3.1.0:
HTML:
<a id="copycommand" href="#" data-clipboard-text="text to copy">Copy ...</a>
ZeroClipboard creates a container with the identifier global-zeroclipboard-html-bridge , this is the access point for the Bootstrap tooltip.
JQuery
// initialize Tooltip $('#global-zeroclipboard-html-bridge').tooltip(); // ZeroClipboad ZeroClipboard.config({ moviePath: 'ZeroClipboard.swf' }); var clip = new ZeroClipboard(document.getElementById('copycommand')); clip.on('complete', function(client, args){ alert("Copied text to clipboard: " + args.text); }); // settings for the Tooltip clip.on('load', function(client) { $('#global-zeroclipboard-html-bridge').attr({ 'data-toggle':'tooltip', 'data-title': 'Tooltip text goes here ...', 'data-placement': 'bottom', 'data-html': true }); // show the tooltip $('#global-zeroclipboard-html-bridge').tooltip('show'); });
Ralf hertsch
source share