Functions / addAnimateFunction
addAnimateFunction(name, fn)
addAnimateFunction(string name, function fn)

Method for addition of new functions which can be used further in quality easing for function .animate().
addAnimateFunction(string name, function fn)
return: jCanvaScript
Code
<script type="text/javascript">
	function start_1(idCanvas)
	{
		jc('#myCircle_1')
			.animate({x:200},2000,{fn:'myFunction'})
			.animate({y:200},2000);
	}
	function stop_1(idCanvas)
	{
		jc('#myCircle_1')
			.animate({y:20,x:20});
	}
	function onload_1(idCanvas)
	{
		var myFunction=function(progress,params)
		{
			var a=params.a||1;
			var n=params.n||2;
			return Math.pow(progress,4)-Math.pow(progress,2)*a+progress*a;
		}
		jc.start(idCanvas,true);
		jc.addAnimateFunction('myFunction',myFunction);
		jc.circle(20,20,40,'#00FFFF',1)
			.id('myCircle_1');
	}
</script>
<canvas id="canvas_1" width="250px" height="265px">
</canvas>
View