Sha256: b200b1e45398a285ac6ed94c578836b137160a287df01874a64fd00badcde156
Contents?: true
Size: 792 Bytes
Versions: 5
Compression:
Stored size: 792 Bytes
Contents
// Show top page button after scrolling down. $("#topbtn").hide(); $(window).scroll(function() { if ($(window).scrollTop() > 100) { $("#topbtn").fadeIn("slow"); } else { $("#topbtn").fadeOut("fast"); } }); // Instantiate clipboard.js new ClipboardJS('.btn-clipboard', { target: function(trigger) { return trigger.nextElementSibling; } }); // Add button before pre element to complete clipboard.js implementation. document.querySelectorAll("pre > code").forEach((codeBlock) => { const button = document.createElement("button"); button.className = "btn-clipboard"; button.title = "Copy to clipboard"; button.type = "button"; button.innerHTML = "<i class=\"fas fa-copy\"></i>"; const pre = codeBlock.parentNode; pre.parentNode.insertBefore(button, pre); });
Version data entries
5 entries across 5 versions & 1 rubygems