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

feat: allow impetus to be locked a single axis #35

Open azaslavsky opened 6 years ago

azaslavsky commented 6 years ago

Introduces the axis parameter, which can be set to any of "x", "y", true, or false, and defaults to true. "x" indicates that the axis is locked so that only horizontal movement is applied, "y" indicates the same for horizontal movement. false means that no movement is applied in any direction (ie, the element is completely frozen), while true retains the default behavior. getAxis() and setAxis() methods have also been added to retrieve and adjust the locked axis in flight, respectively.