| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sigmoid functions based upon work by Emmanuel Pietriga. wobble and spring come from, or are loosely based on Scriptaculous.
Animation is a Template that passes a position to its run( pos ) method. (you implement run).
anim.Transitions contains effects for speed/timing, such as acceleration and easing.
b = new APE.anim.Animation( "blah" );
b.run = function(position) { // <-- you implement run.
};
b.start(); // <-- then call start.
| Field Summary | |
Number
|
duration
|
Number
|
timeLimit
|
| Constructor Summary | |
|---|---|
APE.anim.Animation(duration)
|
|
APE.anim.Animation(duration)
|
|
| Method Summary | |
|---|---|
|
abort(ex)
Cancels the anim where it is; does not call onend() |
|
pause()
pauses the animation. |
|
reset()
resets the animation to position 0. |
|
resume()
unpauses the animation. |
|
run(position)
Run must be implemented by user. |
|
seekTo(pos, transitionBackwards)
Seeks to a certain position along the duration timeline. |
|
start()
Call this method to start the anim. |
|
stop(ended)
Ends the anim. |
|
toggleDirection()
undocumented |
|
toString()
undocumented |
Number
|
transition(p)
|
| Event Summary | |
|---|---|
void
|
onabort(ex)
If an error occurred, onabort throws the error. |
void
|
onend()
fires when stop() is called or the Animation successfully completes. |
void
|
onstart()
fires when the Animation starts, when seekTo is called. |
| Field Detail |
|---|
Number duration
Number timeLimit
| Constructor Detail |
|---|
APE.anim.Animation(duration)
ufloat duration? - Number of seconds to run the animation (default is 1).
APE.anim.Animation(duration)
ufloat duration? - Number of seconds to run the animation (default is 1).
| Method Detail |
|---|
abort(ex)
ex
pause()
reset()
resume()
run(position)
Number position - 0-1
Implementation generally looks something like:
anim.run = function( position ) {
document.body.style.borderWidth = ( 12 * position ) + "px"
};
seekTo(pos, transitionBackwards)
float pos - Normally [0-1], but can be less than 0 or greater than 1.
boolean transitionBackwards? - If true, plays an inverse of the transition when
the animation is reversed (only applies when pos < this.rationalValue.
start()
stop(ended)
boolean ended
toggleDirection()
toString()
Number transition(p)
p
Number position value, typically betweeen [0-1].
| Event Detail |
|---|
onabort(ex)
Error ex - the error that occured.
Error the error that occured.
onend()
onstart()