Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dynamically update increments and delay? #21

Open
novovic opened this issue Apr 13, 2016 · 2 comments
Open

Dynamically update increments and delay? #21

novovic opened this issue Apr 13, 2016 · 2 comments

Comments

@novovic
Copy link

novovic commented Apr 13, 2016

Hi, is it possible to dynamically update incremental or delay options on already running ticker?
I am currently having an issue that once created counter[0].options does nothing for me after first setup...

Is it possible anyhow?

@novovic
Copy link
Author

novovic commented Apr 14, 2016

In case someone needs it, you just need to tweak tick.js a bit...

In order to dynamically change increment, modify Tick.prototype.build_increment_callback function that in number type instead of val + value; you make it like the following:

} else if (typeof option === 'number') {
  return function(val) {
    return val + this.options.incremental;
  };
}

I've started improving on existing code at https://github.com/novovic/tick

@RaymondChee
Copy link

@novovic , Hi I'm new here, and I've added the the version of your improvised code, but I still cannot have the random incremental effect. Any help would be much appreciated!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants