Comments (3)
I just tested this exact example for 5 minutes, and mine was only a few seconds behind. I noticed my clock didn't get out of sync until I left one browser to in the background and did other stuff while the clock runs... I am not sure what would cause this considering I am using the system time and just passing the number of seconds that have passed to the clock, and it just performs a flip. It's almost as if this is a cpu/browser issue. I am not sure how to fix it off the top of my head.
from flipclock.
Hi Justin,
I love your app by the way.
I'm going to have to resort to the most accurate option. Here is what I
found. The code below is a simple countdown timer that runs an interval and
constantly finds the current time difference and refreshing the html.
I hope this helps in some way. Thanks for your reply.
window.onload = function() {
var minutes, seconds;
var countdown = document.getElementById("countdown");
var target_date = new Date(new Date().getTime() + (25*60000))
setInterval(function () {
var current_date = new Date()
var seconds_left = (target_date - current_date.getTime()) / 1000;
minutes = parseInt(seconds_left / 60);
seconds = parseInt(seconds_left % 60);
// format countdown string + set tag value
countdown.innerHTML = minutes + "m, " + seconds + "s";
}, 1000);
};
from flipclock.
That's pretty much the same thing I do. At this point I will just keep an eye on this, because I am not sure how to fix it. If anyone else has any insight, just let me know.
from flipclock.
Related Issues (20)
- Default negative values support confuse people HOT 1
- JS6 - minute face - seconds issue
- Project status? HOT 9
- flipclockjs.com is down HOT 2
- Creating a
- How to properly destroy a running flipclock instance? HOT 2
- Can't get it to work?
- please change documentation link to http://web.archive.org/web/20191208040027/http://flipclockjs.com/ HOT 4
- Reset on Zero
- False Translation Alias for italian HOT 1
- Docs website is down http://flipclockjs.com/ HOT 1
- ES6 docs?
- When the countdown ends, it doesn't stop HOT 2
- Bump marked from 1.1.1 to 2.0.0 security issue is raised
- stopAt attribute does not work for countdowns HOT 2
- HourCounter face does not work for countdowns
- when I am refreshing the page it gets reset and start the timer from the beginning what I do please tell me what I add extra in this code.
- Flip Clock just disappeared from the page
- Clock
- Countdown page reload does not work properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipclock.