Jump to content
MakeWebGames

Recommended Posts

Posted

Hey all,

I am trying to get time to count down dynamically (no need to refresh page) instead of statically, but just can't figure it out for the life of me.

Basically when somone adds something to the construction que it calculates the time to build it in seconds (lets say 3600 seconds) and put's it into the database:

time()+3600

etc, then, when I use a function to turn this into hours mins seconds etc and display it on the construction page and it "counts down" but only when the user refreshes the page.

Is there a way using JS or jQuery to make this dynamic? Just the displaying of the time?

Hope I explained this well enough!

Posted
Well just tried "Countdown" in the search in the thread mentioned came 2nd.

Moral of the story, search people search... :P

Okay, so i havn't looked at or used jQuery before, so how do I get that to take the input from the database as a timestamp?

Also, can't seem to get it to countdown =S

Well you need to include jQuery.

Then it all depends on which version of the code on that topic you are using.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...