Documentation

include MVC MVC.Animate MVC.Class MVC.Controller MVC.Controller.Action MVC.Controller.Action.Drag MVC.Controller.Action.Drop MVC.Controller.Action.EnterLeave MVC.Controller.Action.Event MVC.Controller.Action.Hover MVC.Controller.Action.Lasso MVC.Controller.Action.Selectable MVC.Controller.Action.Subscribe MVC.Controller.Comet MVC.Controller.Params MVC.Controller.Params.Drag MVC.Controller.Params.Drop MVC.Controller.Stateful MVC.Delegator MVC.Doc MVC.Element MVC.Event MVC.File MVC.History MVC.IO MVC.IO.Ajax MVC.IO.Comet MVC.IO.JsonP MVC.IO.WindowName MVC.IO.XDoc MVC.Model MVC.Model.Ajax MVC.Model.Cookie MVC.Model.JsonP MVC.Model.JsonRest MVC.Model.WindowName MVC.Model.XmlRest MVC.Native MVC.Native.Array MVC.Native.Date MVC.Native.Function MVC.Native.Number MVC.Native.Object MVC.Native.String MVC.Options MVC.Store MVC.SyntheticEvent MVC.Test MVC.Test.Assertions MVC.Test.Controller MVC.Test.Functional MVC.Test.Runner MVC.Test.Unit MVC.Timer MVC.Timer.Easings MVC.Vector MVC.View MVC.View.Helpers OpenAjax

MVC.Timer

Provides simple timing functionality.
 var t = new MVC.Timer({
   time: 1000,
   from:  1,
   to: -1,
   interval: 5,
   onUpdate : function(value){ ... }
   onComplete : function(value){ ... }
   easing: "linear"
 })
 t.start();

Constructor

MVC.Timer

new MVC.Timer(options) -> mvc.timer

{Object} -
OptionDefaultDescription
time 500 Time the timer runs in ms.
from 0 The starting value of the timer
to 1 The end value of the timer.
interval 1 Millisecond time between calls.
onUpdate Called each time a new value is ready.
onComplete Called when the timer is complete.
easing "swing" The name of an easing or easing function.

start

start() -> undefined
Starts the timer.

kill

kill() -> undefined
Kills the timer.