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.
We are going to be using a code block to do this , as our back to top button is going to be created with JavaScript and styled with CSS. Doing this without a plugin not only results in a faster loading website, but enables you to completely modify all aspects of this functionality.
We're going to be placing this code block directly into the footer template (this tutorial requires you to be using templates), meaning that our JavaScript will not be render blocking.
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.
Finally, paste in your JavaScript which ties the CSS styling to the HTML element.
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.
This tutorial should have presented you with an easy and free way to add a back to top button to your Oxygen Builder website. With just a little HTML, CSS, and JavaScript, you can have a fully functional button Apply to any aspect of your website. Place it in the footer to add the button to the entire website, or selectively choose templates.
If you have any questions about how to do this, feel free to reach out in the comments.
you can replace the text with an icon ?
How can I replace the text with an icon you can help