chrisbateman / impetus

Agnostic utility for adding momentum to anything. It's like iScroll, except not for scrolling. Supports mouse and touch events.
chrisbateman.github.io/impetus
MIT License
487 stars 70 forks source link

option to lock arbitrary axis #16

Closed abusedmedia closed 3 years ago

abusedmedia commented 8 years ago

Hi @chrisbateman

Here's my proposal to add the option for using more than one Impetus instance in nested elements, with the ability to prevent the default event propagation.

You can check a working example that shows how it should behave (there are 3 nested scroll element with 3 instances of Impetus): http://jsbin.com/likefo/edit?js,output

and the same example with the original Impetus version: http://jsbin.com/yizoye/edit?js,output

Feel free to propose any refactoring or different implementation. Please keep this great piece of code up.

Cheers

chrisbateman commented 7 years ago

@abusedmedia Do you think we could just use the existing trackingPoints rather than creating a new set of waitingPoints?

Sorry for the delay.

abusedmedia commented 7 years ago

Hi @chrisbateman

I think they have two different purposes, nevertheless, they can be merged changing, I suppose, the actual implementation of the feature.

All my best