How do you set up Smooth Scrolling in Origin Theme

How do you set up Smooth Scrolling in Origin Theme

JeremySkeggs
Excursionist
24 1 5

Hi All

I have Shopify Origin as a theme.

I have added a Anchor to scroll to from the "Shop Now" button to "Buy Box" at the bottom of the page (this is a sales Landing Page).

I want the page to slow scroll. I have tried adding all of the codes i have found and have also tried the a custom.js option 

 

 Can anyone guide me around this issue

https://www.upanfrypan.com/pages/landing-page

 

Thanks in advance

 

 

 

Replies 4 (4)

store-crafters
Shopify Partner
24 1 1

Hello,

All you need is to put below code in your css file 
html {
scroll-behavior: smooth;
}

If it works for you, do leave a like 🙂

JeremySkeggs
Excursionist
24 1 5

Hi Tanish,

Thanks for the response, that doesn't work in the base.ccs file, it stops the anchor link from working as well. Doing that or encasing it in <script> and adding it to the theme.liquid file.

store-crafters
Shopify Partner
24 1 1

Did it not work by placing it in the theme.liquid file as well?

JeremySkeggs
Excursionist
24 1 5

yes the script i used was as below placed above the </body>

<style>
html{
scroll-behavior: smooth;
}
</style>