You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for creating the great timer script!
I am aware of the "pause" button from your sample page, my problem is I only have 3 buttons. Start, Pause/Resume and Stop. The Pause button should resume the timer when clicked again after being paused.
I tried to change the class after the click on the pause button from "pauseButton" to "startButton" but this didn't help. Is there anyway to do this?
thank you so much for the quick help. This worked perfectly! I appreciate it.
Also, I would suggest to add this code snippet to the documentation as I'm sure more people would like to use the same button for pause & resume.
Anyways, thanks again for the help & developing this easy timer!
Hello,
thanks for creating the great timer script!
I am aware of the "pause" button from your sample page, my problem is I only have 3 buttons. Start, Pause/Resume and Stop. The Pause button should resume the timer when clicked again after being paused.
I tried to change the class after the click on the pause button from "pauseButton" to "startButton" but this didn't help. Is there anyway to do this?
Here's my HTML:
<div id="controls" class="recordingTime"> <button id="recordButton" class="startButton" onclick="displayStopwatch()"><i class="fas fa-microphone"></i></button> <button id="pauseButton" class="pauseButton" disabled><i class="fas fa-pause"></i></button> <button id="stopButton" class="stopButton" disabled><i class="fas fa-stop"></i></button> </div>
That's my current timer code:
// show recording time var timer = new Timer(); $('.recordingTime .startButton').click(function () { timer.start(); }); $('.recordingTime .pauseButton').click(function () { timer.pause(); }); $('.recordingTime .stopButton').click(function () { timer.stop(); }); timer.addEventListener('secondsUpdated', function (e) { $('.recordingTime .values').html(timer.getTimeValues().toString()); }); timer.addEventListener('started', function (e) { $('.recordingTime .values').html(timer.getTimeValues().toString()); });
The text was updated successfully, but these errors were encountered: