简体   繁体   中英

On scroll animate to next div on iPad?

I have been trying to search for different things, but I couldnt find the suiting solution for my problem.

I need to scroll to the next div, when you swipe up on the iPad, so the div's top snaps to the ipads top. I think this would be simply on .scroll in combination with .scrollTop() , right? So now when you scroll, it should detect either you scroll down or up, and when you do so, jump to the next or previous div.

Has anyone a ressource, where I can find a solution to this?

Thanks in advance

I've done the exact same thing a while ago for my Personal Website . (if you check it with a tablet or a smart phone you can see it in action)

what I used was:

  1. jQuery Mobile : to detect touch moves and unbind the scroll
  2. Touch Swipe Plugin : to detect the direction of swipe
  3. And the rest is simple jQuery animation using scrollTop() and offset()

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