简体   繁体   中英

Body vertical swipe to scroll with hammerjs

I would like to mimic touch device scroll behaviour with hammerjs I can listen to swipe events and stuff and make calculations to animate to position based on velocity but it wont be like it work on touch device exactly.

Maybe someone already did that and know where I can find it or how I can do it as close as possible to the origin?

I would appreciate your help

Maybe it will help you, that Hammer.Pan(i am sure of) and Hammer.Swipe(i did not investigate) are set to Horizontal only! To enable vertical panning and i guess swiping as well is to set All directions explicitly.

I am referring to latest version 2.0.8 (which was actually never updated on github. Still looks like 2.0.7 code) :(

mc.get('pan').set({ direction: Hammer.DIRECTION_ALL });

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