Giter Site home page Giter Site logo

Comments (10)

wimbarelds avatar wimbarelds commented on July 19, 2024

You can do

$("#Timer").TimeCircles().addListener(function(unit, value, total) {
   if(total <= 0) {
       // Do whatever you like here
   }
});

from timecircles.

Fatbat avatar Fatbat commented on July 19, 2024

Sorry man, can you be a bit more specific about the "Do whatever you like here" part? For example, I'm only showing a seconds timer, I have the word "Seconds" hidden. So in this example, I'd like to change the "0" to say something different at the -1 second mark, and probably in a different sized font so it will fit.

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

It really depends on what exactly you want. Personally I'd be more inclined to try something other than to put text inside the circle. IE; I'd fade out the time circles (Fully or partially, either would be fine) and show something overlaying that.

But as I said, it depends on what exactly you'd want to show at that point. Try be more specific about what you're trying to accomplish.

from timecircles.

webchun avatar webchun commented on July 19, 2024

Hi @wimbarelds is it posible to make the counter stop when the timer reaches zero?
Nice script btw, thanks!

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

Yes, simply set count_past_zero to false. Check the readme.

from timecircles.

webchun avatar webchun commented on July 19, 2024

errrr my bad -_- Thanks @wimbarelds :)

from timecircles.

yuhao-nyc avatar yuhao-nyc commented on July 19, 2024

Hi @wimbarelds the suggestion you put earlier worked great if(total <= 0).
I was trying to achieve something like when the countdown ends, hide one box and show another, everything is working until I refresh the page, the previous box I'm trying to hide comes back. Seems like the if (total < =0) only works on the "moment" when countdown is over. any ideas? Thanks!

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

Are you using data-timer or data-date?

from timecircles.

yuhao-nyc avatar yuhao-nyc commented on July 19, 2024

yes i am using data-date @wimbarelds anything related to this?

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

You can save the status in localStorage and check that before you initialize TimeCircles; that seems like the simplest solution.

from timecircles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.