简体   繁体   中英

Any way to synchronize CSS transitions with touch events (swipe)?

For example, if the swipe is slower, transition speed should also slow down.

If this is not possible with only CSS, what would be the least painful way to approach this with javascript? Essentially I'm trying to avoid declaring the transition rules in javascript.

You could stablish the rules for the transition in CSS (transition-property, transition-delay and transition-timing-function), and use javascript just to set transition-duration. This way everything is set up in CSS except the duration, which is what you want.

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