I'd like to count from 0 to n in x seconds and call a function on each step.
For instance:
var count = 0, targetCount = 100, duration = 500, timing, interval; timing = duration / targetCount, interval = setInterval(function() { count ++, console.log("call onIntervalProgress()", count); if(count === targetCount) clearInterval(interval), console.log("call onIntervalDone()", count) }, timing); The problem is that I don't want to do it that linear. I'd like to use easing for that job. I know that jQuery provides timing functions. Is it possible to use jQuerys "swing" on non CSS stuff?