Little Javascript Stopwatch I Made

Discussion in 'Web Design & Programming' started by Matt555, Jun 10, 2007.

  1. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48

    Attached Files:

  2. Addis

    Addis The King

    Likes Received:
    91
    Trophy Points:
    48
    It doesn't work for me, when I open it in firefox and konqueror nothing happens when I press start.
     
  3. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
    Ahh, yeah, that code I pasted was something I was testing. My bad, I'll edit and put the working code in.
     
  4. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    working fine here, good work dude!
     
  5. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
    Thanks man :)

    I decided to scrap pasting the code into the post as it didn't like that for some reason :S

    I think I'm going to work on a timeDifference() function to give the times in between laps :)
     
  6. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
    Also - if anyone has any suggestions on extra features for the stopwatch let me know :)

    I'd like to add some more features, make it a bit more useful (even though it's still just a silly little app I made when bored).
     
  7. blade

    blade GEEK 2.0

    Likes Received:
    0
    Trophy Points:
    0
    i wish i can make stuff like that with ease when im bored :p; but yea, good job
     
  8. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
    Hehe thanks - once the basics were done adding simple little things to fix bugs was fun - like disabling the buttons, that stopped problems that people had when the clicked buttons when they weren't needed :p

    PS - I've just validated it to xHTML Strict 1.0 - thought I may as well :)
     
  9. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
    Just finished a new version: It now stores the lap times in an array as opposed to just displaying them on screen :)

    Code:
    Version history:
    
    0.0.1 [10th June 2007]
    - Stopwatch created with start and stop functions,
    
    0.0.2 [10th June 2007]
    - Lap and reset functions added,
    
    0.0.3 [10th June 2007]
    - Un-needed buttons disabled,
    
    0.1.0 [11th June 2007]
    - Stopwatch stlyed using CSS,
    - Page validated to xHTML Strict 1.0,
    - Javascript code placed into separate file,
    
    0.1.1 [11th June 2007]
    - Lap time results placed into an array as opposed to simply displayed on page,
    - The array should allow for some manipulation,
    Simple Javascript Stopwatch
    .zip File including all code

    If anyone has any suggestions on version number please let me know - it's something I've never quite understood...
     
  10. Sniper

    Sniper Administrator Staff Member

    Likes Received:
    59
    Trophy Points:
    63
    latest one looks pretty neat dude!
     
  11. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
  12. Matt555

    Matt555 iMod

    Likes Received:
    98
    Trophy Points:
    48
    Code:
    0.1.3
    - Time difference between laps added,
    0.1.3
    Simple Javascript Stopwatch
    .zip File including all code

    I'm having a few accuracy issues with the time difference - I'm going to try and recode that at somepoint - currently it uses a separate timer:

    You press the lap button for the first time and it starts the timer, when you press it again, it stops the timer, grabs the results, takes 00:00:00:1 off (as it had a problem with adding it one for some reason) and puts them into variables to display on screen - it then resets the 2nd timer to 00:00:00:0 and starts this second timer again, waiting for the lap button to be pressed again.

    I think I've found a problem - I can't remember if I set the pause button to pause the 2nd timer and the reset button to reset the 2nd timer...
     

Share This Page