Count down

  • Tone2k11
  • Proficient
  • Proficient
  • Tone2k11
  • Posts: 493
  • Loc: Southampton - UK

Post 3+ Months Ago

Hi all,

I am looking to get a simple countdown. Basically i want to add it to a clients website so that it counts down the days, hours & minutes and seconds to the actual wedding.

After the wedding time i would like it to say how many hours, minutes and second since the wedding.

I would like it simular to the one found on this page -

http://www.julieandrob.co.uk/home.htm
(Its at the bottom)

I know the example i showed above is in flash, but is there anyway to do it in html?

I hope that some one is able to help me.

Thanks

Tony
  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

I am pretty sure that can be achieved using php. Now how that would be done, I am interested in finding that out myself.
  • Sultan
  • Newbie
  • Newbie
  • Sultan
  • Posts: 11

Post 3+ Months Ago

Simple and easy: http://www.dynamicdrive.com/dynamicinde ... lcount.htm

Have fun
  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

but I know it can be done in php. not everyone uses javascript, and php is serverside, so everyone would be able to see it.
  • Sultan
  • Newbie
  • Newbie
  • Sultan
  • Posts: 11

Post 3+ Months Ago

For PHP just look through http://www.hotscripts.com

Javascript is widely used these days, if this were 1997 you would have to worry about JavaScript causing availability issues. There are still compatible issues there's no denying that, but to worry about someone not being able to see JavaScript is being a little paranoid. Unless you're one of the "My site 100% compatible with every computer, laptop, PDA and wrist watch in the world."
  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

hmmm, good point
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Sultan wrote:
Javascript is widely used these days, if this were 1997 you would have to worry about JavaScript causing availability issues. There are still compatible issues there's no denying that, but to worry about someone not being able to see JavaScript is being a little paranoid. Unless you're one of the "My site 100% compatible with every computer, laptop, PDA and wrist watch in the world."


Roughly 8-10% of users have javascript disabled. I'd say 8% is a sizeable chunk. It's not the compatibility that make javascript an issue, it's the fact that you simply cannot rely on it even being there. Just because it works in a browsers does not mean the users will be able to see it.

To many people take javascript as a given, and use it for all sorts of vital functions on their site. It's simply dumb, it's like saying only 10% use mozilla, so my sites don't need to work on MOZ.

Also javascript will have issues with system clocks and time zones, making the countdown inaccurate. that you can easily sidestep using php. Just a thought.
  • Tone2k11
  • Proficient
  • Proficient
  • Tone2k11
  • Posts: 493
  • Loc: Southampton - UK

Post 3+ Months Ago

Thank-you all, I am going to look for a php version. If not then i will go with java-script (last resort)

If anyone finds a script that will acheive what i am looking for then please do let me know.

Thanks

Tone
  • Sultan
  • Newbie
  • Newbie
  • Sultan
  • Posts: 11

Post 3+ Months Ago

PHP:
http://www.hotscripts.com/cgi-bin/searc ... wn&catid=2

Have fun

Quote:
Roughly 8-10% of users have javascript disabled.

Its actually 5% according thecounter.com
http://www.thecounter.com/stats/2004/July/javas.php


Point noted, but for a script such as a countdown which is not a vital part of a site, I personally would not take it into consideration. If the javascript version gives me more functionality, I'll use it.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Sultan wrote:
Quote:
Roughly 8-10% of users have javascript disabled.

Its actually 5% according thecounter.com
http://www.thecounter.com/stats/2004/July/javas.php

Browser stats vary, and none are accurate, so the truth is probably somewhere between the two. I always assume 10% on the better same than sorry.

I was thinking about this 5 mins ago, about implimenting a php/javascript combo, where the php generates the days, hours, mins, seconds and outputs it to the page. Then you write a javascript that kicks in and alters the figures in time with the system clock. JS users get full functionality and no js users get the time from when the page loaded.

Hows that for a compromise? Think I'll go write that one now.
  • Tone2k11
  • Proficient
  • Proficient
  • Tone2k11
  • Posts: 493
  • Loc: Southampton - UK

Post 3+ Months Ago

That is exactly what i need rtm, coz looking at the php ones that was the draw back, they only change on refresh. Having a combined one would be excellent.

Thanks

Tony
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Had some major issues with some of the funtions, but here goes:

Countdown to the reading festival 2004 :)

When it gets to 0, it does not go into minus figures. To show how it works, you can view the turbo version, which is really just to demonstrate that the hours minutes and days changing works, without me sitting here for days lol:

Turbo Countdown

Needs some faffing with for user-friendliness, but you get the idea.
  • Tone2k11
  • Proficient
  • Proficient
  • Tone2k11
  • Posts: 493
  • Loc: Southampton - UK

Post 3+ Months Ago

Wow thats great! So can i use that? Just customize the font color etc?

Well done.

Tony
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Yeah, sure, just gotta edit it a bit though first, I'll get back to you on that sometime this weekend.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

OK all done, I think. There are two ways of including the javascript into the file. You can either link to the external file cd.js.php or echo the script into the document:

script in head:
http://www.caffeinefuelled.net/richard- ... countdown/

script in external file:
http://www.caffeinefuelled.net/richard- ... index2.php

(So you can see what I mean)

source files:
http://www.caffeinefuelled.net/richard- ... .08.08.zip
edit: version2 of source files can be found here, I've just neatened ups some of the files:
http://www.caffeinefuelled.net/richard- ... .08.13.zip



The index.php and index2.php will show you the two ways of incorporating the script into your pages. You should call the echoTime() function with a date in international date format:

Code: [ Select ]
echoTime("2004/10/08 13:00:00");


yyyy/mm/dd hh:mm:ss

It should be stable with other date formats but don't risk it lol. also 24 hour clock is a good idea too.

you must have the date inside an element with id="date". It does not have to be a div, it can be a td, a paragraph, even a link, but if it does not have id="date", the javascript will not work.

Should be all quite simple, but any questions give me a shout. Ant technical problems (bugs) let me know as well.

Enjoy

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 32 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.