简体   繁体   中英

JQuery Jump To Div On Small Scroll

I do not know how to explain it in words. I have this website and I want to know how I can jump divs when a small movement is there. Is there a tool out there? Thanks

EDIT:

OK so when the user scrolls just slightly with the scroll wheel on their mouse, it should show the next div. I have 4 full page divs and I want to move the scroll wheel just a little bit and it should go to the next div in the proper direction. (Sometimes parallax sites do it. They have the number of divs in dots on the side and you can scroll or click the dot to go to another section/div)

you are going assign an id to the sections in your page ex

<div id="section1" >

</div>

doesn't have to be <div> , can be any element type

then anywhere on the page make a link , like :

< a href="#section1" >   Go To Section 1 </a>

If I'm understanding correctly, you're looking for a combination of jQuery scrollTop() and focus(). Based on scroll position, focus on an element. Note this is bad for accessibility reasons, depending on your user base and needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM