Post
Topic
Board Meta
Re: Tampermonkey Script to use on this forum
by
Pablo-wood
on 13/05/2025, 07:45:03 UTC
✅ "Back to top" button for long threads
--

Code:
    // ==== "BACK TO TOP" BUTTON ====
    const topBtn = document.createElement('button');
    topBtn.textContent = '↑ Top';
    topBtn.style.cssText = 'position:fixed; bottom:20px; right:20px; padding:8px; z-index:9999; cursor:pointer;';
    document.body.appendChild(topBtn);
    topBtn.addEventListener('click', () => window.scrollTo({ top: 0, behavior: 'smooth' }));
})();
Nice work geek. I am impressed with this feature the most.  I was wondering why you didn't bother adding backgroundColor to your button?. Although it doesn't matter anyways since the appearance isn't too bad. Most people might be skeptical in using your script because you are are still a jnr member but it's fun you put up this harmless script though as a little contribution to the forum.