In this tutorial, we're going to quickly add a back to top button to a website created with the Oxygen Builder.
There are a couple of expensive add-on packs for the Oxygen Builder which include a back to top button, but luckily there are also free methods of doing this that don't require a massive capital outlay.
Adding a back to top button to your website created with Oxygen has a whole host of benefits.
If you don't have a sticky menu, a back to top button is a great way to lower your bounce rates. It gives your visitors an easy way to access your menu and additional header links after reading a long article.
By lowering bounce rates, you could increase the revenue generated with your website, and lead to happy visitors. That makes the three minutes it takes to implement and add to top button in the Oxygen Builder definitely worth it.
Now let's take a look at how to actually add a back to top button into your Oxygen Builder.
The first step is identifying the code that you actually want to use to implement the back to top button In your website. There are tons of examples out there, but we're going to be using a basic snippet which we found on https://www.w3schools.com/howto/howto_js_scroll_to_top.asp.
The code that makes up this back to top button is incredibly simple, easy to implement on the Oxygen Builder, and only displays the button when the user scrolls down the page.
Now that we have our code, let's add a code block to the Oxygen Builder. As stated before, we are going to be adding this code to the footer of our Oxygen website. Keep in mind, this method will apply the back to top button on all pages on your website. Depending on your needs, this may be unwanted. if you only want to apply this button to your blog posts, you can choose to incorporate this code at the bottom of the inner content of your single post template.
Once you've identified where exactly this code is going to be placed, add a code block to the respective location and begin adding your code snippets. First comes the HTML element:
Then we will add the CSS styling. You can add or remove lines as needed.
Click apply code, scroll up and down the page, and the back to top button should appear.
To make the back to top button fit better into our Oxygen Builder website, we changed the background to white and added a box shadow.
You can also choose to make the button circular by Setting a standard width and height in CSS and making the border radius something like 50 pixels.
You can even replace the text with an icon, as font awesome is included with Oxygen Builder. Keep in mind, if you want to do this, you would either need to include the icon as an SVG path, or host font awesome locally.
If you have any questions about how to do this, feel free to reach out in the comments.