Public Voice Network
- Auto Racing? 66
- QBN Personas 1111
- Pic of the Day 7479074790
- Align shortcode Divs? 1616
- Chick of the Day 1825518255
- Viewing Old PC Hard Drive… 77
- Paid vacation? 2727
- You're Doing It Wrong… 88
- weird 3d stuff 9696
- The Purge 2020
- blog 5771357713
- Hiphop like this. 7474
- DaftPunk 224224
- the gif animation thread 1849618496
- CSS z-Index 11
- Cape Cod 1414
- Technological Eye Strain 1717
- Best American band of all… 127127
- Bitcoin 130130
- QBN EXPATS 4141
- Architecture of the Day 436436
- Cool tumblr themes? 1010
- Cool Topic-Specific Websi… 22
- Vid of the Day 1507815078
Javascript Count Up 1111 Responses
Last post: 1 year ago | Thread started: May 10, 12, 12:22 p.m.
- Stugoo
i guess you could use a simple timer like this
http://stuntsnippets.com/javascr…but reverse the start time and end time and have the time increase to a point.
a quick google returns this
http://css-tricks.com/forums/dis…

- Dog-earMay 10, 12, 12:34 p.m. – Permalink
- dbloc
http://css-tricks.com/forums/dis…
this one restarts on refresh. I need it to work off the time.start at 7:00 and start counting up


- Dog-earMay 10, 12, 1:12 p.m. – Permalink
- Hombre_Lobo
^sounds like php / asp is the best way to go, like spot13, server side will be easier. no idea how to though :/


- Dog-earMay 10, 12, 1:31 p.m. – Permalink
- monNom
you can grab the UTC time on load, subtract from the target time (in UTC), and start from there. The only issue is if the user's clock is incorrect (in which case you could pass UTC time from server as a variable).
Javascript Date object and setInterval (to write out the clock) would make short work of this.


- Dog-earMay 10, 12, 1:55 p.m. – Permalink
- monNom
if you want to rebase your client's clock to the server clock, pass the server time into a javascript variable, subtract from the time returned by a new Date() object, then add (subtract?) that to the time each time you create a new date object..
ie:
var serverTime = 123456;
var clientTime = new Date();
var rebase = clientTime-serverTime;
var WhatTimeIsItReally = new Date() + rebase;

- Dog-earMay 10, 12, 2:18 p.m. – Permalink
- dbloc
actually this was best JS based on users clock
http://praveenlobo.com/techblog/…count up and count down versions


- Dog-earMay 10, 12, 2:40 p.m. – Permalink


