Evan Gladstone
Evan Gladstone

Reputation: 127

How to make a smooth scrolling effect using javascript

I've been looking everywhere and I cannot find an answer for this specific need.

I want to create a page with this effect - I want the page to scroll down automatically and smoothly to a certain section on the page as soon as the user begins to scroll their mouse. The problem with using the plugin linked above is that I already have my page designed the way I want, I just want to implement this scrolling effect. I am by no means a javascript expert - I deal mainly with the layout aspects of web. But if someone could show me how I could use javascript to automatically drop to a certain section on the page when the user begins to scroll, I would GREATLY appreciate it. Thank you!

Upvotes: 1

Views: 333

Answers (1)

Rushabh Sheth
Rushabh Sheth

Reputation: 177

Try Using Nice Scroll

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.nicescroll/3.7.6/jquery.nicescroll.min.js"></script>

$("#thisdiv").niceScroll({
    mousescrollstep: 40, // scrolling speed with mouse wheel (pixel)
});

Upvotes: 1

Related Questions