jQuery UI 'easeoutbounce' needs to be more bouncy

前端 未结 1 639
日久生厌
日久生厌 2021-01-07 15:32

I\'ve created a div which drops to the bottom of the screen on click. It needs to bounce, so I\'ve used \'easeOutBounce\' as the ease effect. It works nicely but the clien

相关标签:
1条回答
  • 2021-01-07 16:08

    This question is old, but it doesn't appear to have been answered. Happened across it because I had the same issue only opposite (div needed to be 'less bouncy'). The solution I came up with was a quadratic equation to govern each bounce (maybe not the most elegant). Here is a jsfiddle: http://jsfiddle.net/NtkNB/194/ This one is less bouncy than the default jquery animation. To make it more bouncy, you will just have to change the equation, which is kind of a pain.

    var thing = (-17.34*x*x)+(14.351*x)-2.944;
    

    I used wolfram to determine: http://www.wolframalpha.com/input/?i=quadratic+through+%28.343%2C0%29%2C%28.4715%2C.1%29%2C+%28.6%2C0%29

    0 讨论(0)
提交回复
热议问题