Countdown to Copenhagen

We are organising a number of activities and a petition in the countdown to Copenhagen.

Show the counter

If you have a website or a blog, you may want to show our countdown counter. All you have to do is paste the small block of HTML shown below into your page and the counter should appear and run for all your visitors.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
 var mistweb_countdown_headerStyle = 'color: red;';
 var mistweb_countdown_figureStyle = 'font-size: x-large; font-weight: bold; color: red;';
</script>
<script type="text/javascript" src="http://j-can.org.je/script/countdown.js"></script>
<div id="counter"></div>

FAQs

How do I alter the size/font/colour?

Those two lines that begin 'var' have some CSS between single quotes for the headers (like 'Hrs', 'Mins', etc) and the figures (23, 12 etc). You can experiment with these until you like what you see. To find out what values are possible for each property, have a look in the CSS spec. Sections 14, 15 and 16 are most relevant. Please note that the American spelling of colour, the exact order of the : ; and ' characters etc are important, unfortunately.

Can I alter the way it works?

The code is released under the GPL, so yes, that is a licence designed to give you the freedom that you may run, study, distribute and alter it.1) If you understand JavaScript, HTML and CSS well enough to alter the code, I'm sure you're familiar with the GPL, but if not, please read it up.

How do I change it to count down to some other date, like my birthday?

The date is named in the source code as 'target'. Take care that the month number, at least, is zero-based, so 11 really is December. If you want to change anything in that file, then the GPL applies and you must save and host your own copy, then change the HTML to fetch that copy and not ours.

What happens when people click on the counter?

They get taken to this website. Again, if you want to change that, the same applies as for changing the target date.

Is the counter accurate?

It's based on your own computer's clock, compared to the fixed target time. I checked it against http://tcktcktck.org/ and it seemed to agree to within a second or two. I'd be interested to hear how it compares on a computer that is set to some other time-zone.

What will it do when the target date arrives?

At the moment, it will just break. I have three months to think of something and will update the code as time goes by. That's a good reason to use the J-CAN version of the code - by using the HTML above rather than hosting your own copy - you and your visitors get our updates automatically.

What are you talking about? I can't see any counter!

It is possible that you have JavaScript disabled. If you are using Firefox on Linux, go to Edit → Preferences; for Firefox on Microsoft Windows, go to Tools → Options. In either case, then click on the Content tab and make sure 'Enable JavaScript' is ticked. If you are using some other browser, the setting is in there somewhere - try the Help menu or Google.

 
show_the_counter.txt · Last modified: 2009/09/07 22:15 by nigel
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 2.0 UK
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki