How can I put a "Back on top" button in a custom footer?

Hello support,

I have made a custom footer for my website Property Managers – Magellano – Software per Affitti Turistici (medialabproject2.com) but due to the fact that I generated a custom footer, I do not have or find the option to insert a "back on top" button in the page.

The "back on top" option is blocked because it says the Footer Builder is active (and I understand it) buti in the Footer Builder I cannot find any option or element I can use in order to make a "back on top" button

Comments

  • How do I upvote this?! I have the same question.

  • Hi guys,

    you can easily use Icon Box in footer with #Wrapper link to the top. It's that simple.


  • edited September 2023

    Thank you! Would you mind sharing the CSS to make it fixed, positioned further right and down (maybe 60px from right and bottom edges), and to appear shortly after scroll or after scrolling a certain % of the page?

  • This requires JS, can't be done with just custom css.

  • edited February 19

    For anyone else looking for it, the custom CSS for the positioning is:

    #back-top {position: fixed; bottom: 10px; right: 100px;}

    #back-top .icon-up-open {background-color: #000000; border-radius: 50%; padding: 3%;}


    Give your button id = back-top


    In order to make it appear after scrolling a certain % of the page, that requires JS:

    window.addEventListener("load", function () {

       window.addEventListener("scroll", function () {

               let topButton = document.querySelector("#back-top");

               let scrollTop = window.scrollY;

               let docHeight = document.documentElement.scrollHeight;

               let winHeight = window.innerHeight;

               let scrollPercent = (scrollTop / (docHeight - winHeight)) * 100;

               if (scrollPercent > 20) {

                       topButton.style.display = "block";

               } else {

                       topButton.style.display = "none"; 

               }

       });

       function scrollToTop() {

               window.scrollTo({ top: 0, behavior: "smooth" });

       }

    })

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.