npm install scrollbounce
or
yarn add scrollbounce
<ul>
<li data-bounce-id="1"></li>
<li data-bounce-id="2"></li>
<li data-bounce-id="3"></li>
</ul>
import bounce from 'scrollbounce'
const stopBounce = bounce()
// if you want to remove the effect later:
stopBounce()
The default effect is pretty subtle. To crank it up you can pass in an effectMultiplier
option.
bounce({ effectMultiplier: 3 })
- Improved edge case handling
- Performance optimizations
- More spring customization
- Support horizontal scroll
- Inspired by the "BouncyLayout" library for iOS
- This library is targeted towards touch devices and won't have any effect on desktop.