Skip to content

Back-to-top link in Invision Community 5

JavaScript code snippet by Matt to add a Back-to-Top footer link.

<script type = "text/javascript">
    document.addEventListener("DOMContentLoaded", function() {
        let newLi = document.createElement("li");
        let newLink = document.createElement("a");
        newLink.href = "#";
        newLink.innerText = "Back to Top";
        newLink.setAttribute('style', 'padding-left: 1em');

        let newIcon = document.createElement("i");
        newIcon.classList.add("fa", "fa-arrow-up");

        newLink.prepend(newIcon);

        newLink.addEventListener("click", function(event) {
            event.preventDefault();
            window.scrollTo({
                top: 0,
                behavior: "smooth"
            });
        });

        newLi.appendChild(newLink);

        let ul = document.querySelector('nav.ipsBreadcrumb--bottom a[data-action="defaultStream"]').closest("ul");
        if (ul) {
            ul.appendChild(newLi);
        }
    });
</script>

Important Information

We are using functional cookies

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.