Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Allow custom easing function #8

Open
ciromattia opened this issue Feb 24, 2017 · 0 comments
Open

Allow custom easing function #8

ciromattia opened this issue Feb 24, 2017 · 0 comments

Comments

@ciromattia
Copy link
Owner

See bfintal#35

E.g. (thanks to @weisk)

...
var step = 0;
var easing = 'easeInOutQuint';
var f = function () {
  step++;
  var progress = step / divisions
  var delay = easings[easing](progress);
  delay = parseFloat(delay.toFixed(2));
  delay = delay * 20; // tends to 20 ms
  ...
  if ($this.data('counterup-nums').length) {
    setTimeout($this.data('counterup-func'), delay);
  }
...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant