4

Very new to this but I have a page of sections that I have a scroll snap function, but when viewed on chrome the transition isn't smooth at all, it jumps from one section to the other far too quickly. Is there any way to solve this??

https://www.matthewjameswilson.com/

This is the code I am using:

html {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-padding: 50px 0 0 0;
}

section {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
} 
  • 1
    Does this answer your question? [Smooth Scrolling in CSS](https://stackoverflow.com/questions/53543484/smooth-scrolling-in-css) – Mohamed Raza Aug 08 '21 at 17:15

3 Answers3

0

you have missed to add an smooth attribute scroll-behavior: smooth; on CSS

html {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-padding: 50px 0 0 0;
  scroll-behavior: smooth;
}
Mohamed Raza
  • 818
  • 7
  • 24
0

I just faced the issue but I think the issue is when we scroll with the mouse then it scrolls very fast that's why it is behaving like this. Try to scroll by using a laptop or tap or mobile it will work as expected on chorom too.

0
scroll-behavior: smooth;

Fixes only when scrolling by clicking an <a> tag. An issue is getting that smooth scroll when scrolling with the mouse wheel.

F. Müller
  • 3,969
  • 8
  • 38
  • 49