How to make the scroll "jump" to a div or internal link in jQuery (or pure JS)?

Asked

Viewed 50 times

0

Example: https://alvarotrigo.com/fullPage/ and https://www.casacomseara.com.br/, as you use the mouse scroll up or down, you will "jump" between the contents or Divs.

That’s what I look for in jQuery, when using scroll, go to the content.

I’ve already tried searching about, the most I could get was "scroll in a fixed way", like every scroll I give, the site moving 100% up or down, it’s a similar solution but it’s not what I’m looking for. The "Trigger" is the scroll, imagining that I have a total of 5 Divs on my site, and I’m in div 3, if I scroll down I would jump to div 4 and scroll up I would jump to div 2, being in div 2 I could go to div 1 or return to div 3, depending on whether I scroll down or up. Unfortunately not to explain using an image, I ask you to visit the site for a greater understanding.

  • Thank you William, I could not find the answer to my question by not knowing the term "scroll Hijacking"Knowing this...you don’t think it’s necessary for this question to have an answer saying that what I’m looking for is called scroll Hijacking at the same time that it deserves a positive vote because I believe many also do not know the term "scroll Hijacking". Then my question would be useful for that.

  • I also do not know the term, but I did a search in the site search for "fullPage" and appeared few questions, the last was the one that contained the solution to the problem. PS: no need to delete your question, duplicate is not "wrong question", it serves as a note, ie your question is useful for people to reach another question, even for google will help.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.