Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Callback and Options in one initialization #198

Closed
djAjax opened this issue May 23, 2016 · 1 comment
Closed

Callback and Options in one initialization #198

djAjax opened this issue May 23, 2016 · 1 comment
Labels

Comments

@djAjax
Copy link

djAjax commented May 23, 2016

Hello,
In the v2.0.4 of countdown there was a second param of initialization a callback function.
Now you introduce the options object also as the second param.
Is there a possibility to use both of them in one initialization?
The problem is that when we set the precision to 1 minute (60000 ms) the html start to be visible after 1 minute, not from start.
How to make the html to be visible from start?

@hilios hilios added the feature label Aug 3, 2016
@hilios
Copy link
Owner

hilios commented Aug 3, 2016

After some though I decided to add a new option parameter to allow better control of the start.

The thing is that its bad to add a callback at the initialization function because it doesn't follow the jQuery/JavaScript conventions for events. So I thought of the defer initialization, so you could start the countdown after the callback(s) are setup, just an example of it:

$('el')
  .countdown('YYYY-mm-dd', {defer: true})
  .on('update.countdown', function() {
    // ... Setup the render
  })
  .countdown('start');

Do you have any considerations?

@hilios hilios closed this as completed in 97c357a Aug 3, 2016
@hilios hilios mentioned this issue Aug 3, 2016
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants