帮助自定义jquery缓动function

我需要一个非常典型的jquery缓动函数。 它基本上与传统的easeInOut缓动相反,因为我希望这个过程从快速介绍到较慢的中间部分再到快速的outro(你可以称之为speedInOut)。

不幸的是,我的数学有点生疏,我需要有人指出我如何开始的正确方向。

双曲线的正弦曲线(sinh)在我正在寻找的方向上有所改变,但我需要它在两个轴上限制在0和1之间。

这是我正在使用的jquery缓动函数框架

$.easing.speedInOut = function(t, millisecondsSince, startValue, endValue, totalDuration) { if(t = 0) return startValue; if(t = 1) return startValue + endValue; // custom function should go here }; 

任何帮助将不胜感激!

我在前面提到的,聪明的同事的帮助下想出了事情(实际上是他完成了所有繁重的工作)。

我最终使用的最终数学公式是:(sinh((x – 0.5)* 5)+ sinh( – (x – 0.5))+(sinh(2.5)+ sin(-2.5)))/(sinh(2.5) )* 1.82)

我还需要在javascript中实现sinh,因为它不是数学对象的一部分,但这很容易:

 function sinh(aValue) { var myTerm1 = Math.pow(Math.E, aValue); var myTerm2 = Math.pow(Math.E, -aValue); return (myTerm1-myTerm2)/2; } 

缓动函数本身如下所示:

 $.easing.speedInOut = function(x, t, b, c, d) { return (sinh((x - 0.5) * 5) + sinh(-(x - 0.5)) + (sinh(2.5) + Math.sin(-2.5))) / (sinh(2.5) * 1.82); };