Scroll offset using header builder in pro

Hi, see here:

I have the menu setup to scroll down to the contact section, but it doesnt “fill” the screen with the light blue gradient. So I added this JS:

window.csGlobal.csHooks.filter('hash_scrolling_offset', (offset) => {
    return offset -10;
} );

It reduced it, but its still there…

Anyway I can make it scroll, so that section is flush to the top of the browser?


Hi @logoglo,

Thanks for reaching out.
To cover up the background you need to add the offset value instead of subtracting it. Your code may look like the following.

window.csGlobal.csHooks.filter('hash_scrolling_offset', (offset) => {
    return offset + 110;
} );

Please remember that the above code will work if copied as it is and doesn’t conflict with any existing style.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We really do not provide support for custom codes which means we can’t fix it in case it conflicts with something on your site nor will we enhance it.


That worked perfectly, thank you!

Hey @logoglo,

You’re welcome! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.