1

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!

dhilt
  • 18,707
  • 8
  • 70
  • 85
Evan Gladstone
  • 117
  • 3
  • 9
  • 2
    *"the user begins to scroll their mouse"* - Do you mean with the mouse wheel specifically? What if the user scrolls by clicking the scrollbar buttons, or by pressing the down arrow key or spacebar? – nnnnnn Oct 25 '17 at 02:15
  • 1
    Evan, using that plugin would be easier than anything we can suggest. There is no magical way for javascript to achieve it, that is why there are plugins for it, because it is not easy. –  Oct 25 '17 at 02:17
  • The following post should point you in the direction you're looking for - https://stackoverflow.com/questions/21450095/how-to-make-mouse-wheel-scroll-to-section-like-in-mediafire-com - but as stated previously, the reason these plugins exist is because they are difficult to create (especially when new to javascript) – Mike Diglio Oct 25 '17 at 02:41

1 Answers1

1

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)
});
Rushabh Sheth
  • 177
  • 1
  • 8