changes working
This commit is contained in:
18
sample-hugo-template/Tech-Club-Blog/assets/js/copyUrl.js
Normal file
18
sample-hugo-template/Tech-Club-Blog/assets/js/copyUrl.js
Normal file
@@ -0,0 +1,18 @@
|
||||
document.getElementById("copyButton").addEventListener("click", copyToClipboard);
|
||||
|
||||
let currentUrl = window.location;
|
||||
let copyTextContainer = document.getElementById("copyText");
|
||||
let toolTip = document.getElementById("toolTip");
|
||||
|
||||
function copyToClipboard(){
|
||||
copyTextContainer.value = currentUrl
|
||||
copyTextContainer.focus();
|
||||
copyTextContainer.select();
|
||||
document.execCommand("copy");
|
||||
|
||||
toolTip.style.animationName = "pan-toolbar";
|
||||
|
||||
setTimeout(function(){
|
||||
toolTip.style.removeProperty('animation-name');
|
||||
}, 2000);
|
||||
}
|
||||
Reference in New Issue
Block a user