From e3e802af11a437c9851aea008c8c91d42d6f2ead Mon Sep 17 00:00:00 2001 From: Kollin Brandenburg Date: Mon, 28 Nov 2016 09:44:37 -0600 Subject: [PATCH] did stuff --- timers.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/timers.js b/timers.js index fd40910..6c3251d 100644 --- a/timers.js +++ b/timers.js @@ -1,4 +1,27 @@ +$(document).ready(function(){ + $('#start').on('click', startTime) + $('#reset').on('click', resetTime) + $('#pause').on('click', pauseTime) +}); +function startTime(e){ + $('#timer').empty().html('Time Elapsed: 0') + startstuff = 0 + theinterval; +} +function resetTime(e){ + $('#timer').empty().html('Stop Watch') +} +function pauseTime(e){ + var pausestuff = $('span').text() + pausestuff++; + $('span').text(pausestuff) + clearInterval(theinterval); +} +var startstuff = $('span').text() +var theinterval = setInterval(function(e){ + startstuff++; $('span').text(startstuff) +},1000)