Permalink
Browse files

Fixes #1084 - Docs example of Fx.Transition was still using the .effe…

…ct method - Added my own transition: ln(x)^x
  • Loading branch information...
1 parent 42a06de commit 0882ec03bc23ee6442ee81b967bc10131f4718f0 @arian arian committed with cpojer Dec 25, 2010
Showing with 10 additions and 4 deletions.
  1. +10 −4 Docs/Fx/Fx.Transitions.md
View
@@ -118,17 +118,23 @@ Returns an [Fx][] transition function with 'easeIn', 'easeOut', and 'easeInOut'
### Arguments:
1. transition - (*function*) Can be a [Fx.Transitions][] function or a user-provided function which will be extended with easing functions.
-2. params - (*mixed*, optional) Single value or an array for multiple values to pass as the second parameter for the transition function.
+2. params - (*mixed*, optional) Single value or an array for multiple values to pass as the second parameter for the transition function. A single value will be transformed to an array.
### Returns:
* (*function*) A function with easing functions.
### Examples:
- //Elastic.easeOut with user-defined value for elasticity.
- var myTransition = new Fx.Transition(Fx.Transitions.Elastic, 3);
- var myFx = $('myElement').effect('margin', {transition: myTransition.easeOut});
+ // Your own function. Here overshoot is bigger (now 1.3) when base -> 1 and base != 1.
+ var myTransition = new Fx.Transition(function(pos, x){
+ return 1 - Math.pow(Math.abs(Math.log(pos) / Math.log(x && x[0] || Math.E)), pos);
+ }, 1.3);
+
+ var myFx = new Fx.Tween('myElement', {
+ property: 'height',
+ transition: myTransition.easeOut
+ }).start(30, 100);
### See Also:

0 comments on commit 0882ec0

Please sign in to comment.