Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Anyone know a Upcounter, Timer?

    Well, been looking for a script that can add x value from x sum from x period every second (or specified time. For example,

    Every second this "timer" shall add the number 1 to the start of 50 sum. Until tomorrow where the total sum would then be 50+(60*60*24), Seconds. Of course the time is steady, like a fixed date and the counting is running every second even though the viewer isnt looking at it. If he leaves for 1 min and comes back the script would then added 60 seconds if it added 1 nr every second.

    Kind of like, countup script, but this counts day and hours. I just want like seconds, or more precisly dollar and cent. (http://www.dynamicdrive.com/dynamici...countingup.htm)

    In addition (not necessary) this "timer" would every hour perform x action. Like show a new image every hour though sounds like u would put this separate since it shall not affect the "timer".

    Another nice thing would be if that after 12 hours the amount added would be changed by x percentage of the current sum. Like for example, after 12 hours the sum would be 50+(60*60*12), 43250 seconds and then it would add for example 1 % of that sum which would be 432,5 increase every second.

    Reason i said, dhtml preferble is because i am gonna use it for a site.

    Anyone know of a "timer" like this i would love to know. Appreciate the aid,

    -Abxi-

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,898
    Thanks
    203
    Thanked 2,530 Times in 2,508 Posts
    You cannot do this with JavaScript as there is no way to read from or write to a file.

    "In addition (not necessary) this "timer" would every hour perform x action. Like show a new image every hour though sounds like u would put this separate since it shall not affect the "timer"."

    This is easy.

    var now = new Date();
    var hh = now.getHours();

    returns the hour (0-23).

    Then displaythe appropriate image accordingly.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •