WhatsApp Web: scroll-to-top button
Adds a floating button that scrolls the currently open chat history to the very top in one click.
Code to copy
// Add a floating button to scroll the open chat to the very top
(function () {
if (document.getElementById('jz-wa-scroll-top')) return;
const btn = document.createElement('button');
btn.id = 'jz-wa-scroll-top';
btn.textContent = '↑';
btn.style.cssText = 'position:fixed;right:20px;bottom:80px;z-index:9999;width:42px;height:42px;border-radius:50%;border:none;background:#25d366;color:#fff;font-size:20px;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,0.25);';
btn.addEventListener('click', function () {
const pane = document.querySelector('#main [data-testid="conversation-panel-messages"], #main div[role="application"]');
if (pane) pane.scrollTop = 0;
});
document.body.appendChild(btn);
})();
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.