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

Complicated callback.. #339

Open
Louboutin1017 opened this issue Nov 3, 2022 · 0 comments
Open

Complicated callback.. #339

Louboutin1017 opened this issue Nov 3, 2022 · 0 comments

Comments

@Louboutin1017
Copy link

Hello Devs,

I'm kind of not sure why the callback and count up function not working.. see my example code.

$(document).ready(function () { "use strict"; // Start countdown $("[data-countdown]").each(function () { var $this = $(this), finalDate = $(this).data("countdown"); $this.countdown(finalDate, function (event) { $this.html(event.strftime("%D days %H:%M:%S")); }); // Callback and countup function if (event.elapsed) { $this.html(event.strftime("After end: <span>%H:%M:%S</span>")); } else { $this.html(event.strftime("To end: <span>%H:%M:%S</span>")); } }); // End });

Thanks for your attention

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

No branches or pull requests

1 participant