Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
375 views
in Technique[技术] by (71.8m points)

javascript - Browser native scrollbar with locomotive smooth scrolling library not the custom

I'm using the locomotive scroll library for smooth scrolling, The js file of this library creates a custom scrollbar to the body and there is even an option we can disable it.

See the demo of locomotive library codepen demo here

Another demo Look at the page it has a custom scrollbar and I need the default browser native scrollbar. Demo

The CSS part of this library makes the native scrollbar hidden.

html.has-scroll-smooth {
  overflow: hidden; 
}

I need the browser native scrollbar should be there and for that, I made the overflow: auto.

But it creates extra whitespace. Is there any way to keep the browser's native scrollbar?

html.has-scroll-smooth {
  overflow: auto; 
}

If it is not possible to use the native scroll bar with a locomotive library please suggest an alternate solution for the same result.

The tweaks I've made it demo

question from:https://stackoverflow.com/questions/65951585/browser-native-scrollbar-with-locomotive-smooth-scrolling-library-not-the-custom

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...