Skip to content

Instantly share code, notes, and snippets.

@MajidSafari
Last active October 2, 2018 12:01
Show Gist options
  • Save MajidSafari/83269c5031d6b5ac91032b0127538b43 to your computer and use it in GitHub Desktop.
Save MajidSafari/83269c5031d6b5ac91032b0127538b43 to your computer and use it in GitHub Desktop.
@caifagithub I use hint.css and some javascript:
clipboard.on('success', event => {
if (event.text) {
showTooltip(event.trigger, 'copied!');
}
});
showTooltip(elem, msg) {
var classNames = elem.className;
elem.setAttribute('class', classNames + ' hint--right');
elem.setAttribute('aria-label', msg);
setTimeout(function () {
elem.setAttribute('class', classNames);
}, 2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment