Smooth Scroll to ID Offset to Allow For a Sticky Header

Have you ever created a smooth scroll to anchor id in Oxygen Builder and had some of the content hidden behind the header? Well this tutorial will demonstrate how to create an offset on the anchor to compensate for the sticky header.

With Oxygen Builder, it is a simple process to be able to get this up and running.

  1. Move down to the section that you would like to add the smooth scroll anchor to and click “Add” then select “Div” from the “basic” section in the left hand pane. Then drag it to the top of your section.
Add anchor div

2. Edit the ID of the div and assign at a value you can link to in the menu. In my case here I have changed it to “data-sheets”. Then add a class name of “anchor”.

3. With the brand new class highlighted go to Advanced -> Layout and make the following changes. Set the value for “Display” to “block” and the value for “Visibility” to “Hidden”.

Next set the value of “Position” to “relative” and set the value of “Top” to the amount of offset you need. In my case this was -200px but this will vary depending on the size of your sticky header.

The last thing we need to do is add the smooth scroll behaviour. Go to Manage -> Settings and click on “Page settings”, then click on “JS Scripts” and enable “Smooth Scroll to Hash Links” and modify the “Scroll Time” if need be.

That it is my friend. If you want to set other anchors just repeat steps 1 & 2 and you should be good to go.

WANT TO WORK WITH FIRTH WEB WORKS?

Interested to find out what we can do for you? Fill out our Project Enquiry Survey and we will get back to you with a custom solution tailored to fill your unique needs.
Project Enquiry Survey
If you want to purchase a block of time for us to work on your website, click on the "Purchase Service Time" button.
Purchase Service Time
If you want to book a video conference call using Google Meet, click the "Book a Meeting" button below.
Book a Meeting

One comment on “Smooth Scroll to ID Offset to Allow For a Sticky Header”

Leave a Reply

Your email address will not be published. Required fields are marked *

Firth Web Works ©2024 All Rights Reserved | Privacy Policy
Top homephoneenvelopechevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram