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!

3
  • 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? Commented Oct 25, 2017 at 2: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. Commented Oct 25, 2017 at 2:17
  • The following post should point you in the direction you're looking for - stackoverflow.com/questions/21450095/… - but as stated previously, the reason these plugins exist is because they are difficult to create (especially when new to javascript) Commented Oct 25, 2017 at 2:41

1 Answer 1

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)
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.