So this was the final version of the clock when I decided I was happy with it. You can check it out here. The one thing I still want to add it for it to auto-size the text to as big as possible for your browser window without overflowing. Someday I’ll figure it out I suppose.
I was up until 2 a.m. because when it was almost done, the first time, I decided that I wasn’t tracking the states as well as I should, so I basically started all over.
Tags: doodle, jQuery, word clock
February 15, 2010 at 3:45 pm |
Do you have any plans to make the world clock a screensaver? It’s awesome!!!
February 15, 2010 at 3:50 pm |
Sorry, wrong clock, I was referring to the slider clock…….
November 2, 2010 at 10:22 am |
can we have it?? like download it please :)
November 5, 2010 at 4:16 pm |
sure, there should be a link in the blog post
January 27, 2011 at 10:20 am |
Nice clock, any chance of a download link to source?
January 27, 2011 at 9:46 pm |
thanks! there’s a link in the post or just go here. you should be able to “view source” in your browser or just “save page as” there’s really no hidden code, it’s all right there.
May 16, 2012 at 2:43 pm |
Hi there
I found a problem, when its 12:30pm the clock doesnt show anything.
I have added this line at the beginning of the hours:
twelve
and at the end:
twelve
the problem its showing twice the twelve text, its actually working with that line
you also can replace “if ( hour < 12 ) {" for "if ( hour <= 12 ) {"
May 16, 2012 at 2:51 pm |
you’re right, i’ll look at the code later tonight and get that fixed… if i can still log in there. i haven’t used that ISP for some time now. they’re just nice enough to unknowingly keep hosting my stuff. thanks for the bug!
May 16, 2012 at 3:04 pm |
Hi there
Delete my old comment, I read well the code and figured it out what to do.
When is its 12:30am the script shows twelve am, but when its 12:30pm the script doesnt show the “twelve” text and only shows the “pm” text.
To get it work only find the line for hours // Hours: in line 137 and replace for this:
// Hours:
if ( oldsplit[3] != nowsplit[3] ) {
var hour = nowsplit[3];
$(“#hours *.lit”).removeClass(“lit”).addClass(“off”);
if ( hour < 12 ) {
if ( $("#ham").is('.lit') ) { } else { $("#ham").addClass("on"); };
if ( $("#hpm").is('.lit') ) { $("#hpm").removeClass("lit").addClass("off"); };
if ( hour == 0 ) { var hour = 12; };
var which = "#h"+hour;
$(which).addClass("on");
}else {
if ( $("#hpm").is('.lit') ) { } else { $("#hpm").addClass("on"); };
if ( $("#ham").is('.lit') ) { $("#ham").removeClass("lit").addClass("off"); };
if ( hour == 12 ) { var hour = 24; };
var which = "#h"+(hour-12);
$(which).addClass("on");
};
and it will work perfect for both 12am and 12pm.