I'm using the countdown timer:
https://coursesweb.net/javascript/countd ... ed-form_s2
I'm having a very hard time adding a "Pause/Resume" button to the javascript. I'm very new to java and would greatly appreciate any help that could be offered. I'M PULLING MY HAIR OUT, WHAT'S LEFT OF IT!
If the link above is not showing up. Please do a search for " Countdown Timer with starting time added into a form ".
Happy Holidays,
Ray
Pause/Resume Button in Javascript Countdown Timer
-
- Posts:2
Pause/Resume Button in Javascript Countdown Timer
Admin
Posts:805
Hello
To this page:
https://coursesweb.net/javascript/countd ... added-form
there is a new version of the Countdown Timer script, with Start /Pause /Resume functions in the same button, and another two buttons for Restart and End.
Happy Holidays,
Marius
To this page:
https://coursesweb.net/javascript/countd ... added-form
there is a new version of the Countdown Timer script, with Start /Pause /Resume functions in the same button, and another two buttons for Restart and End.
Happy Holidays,
Marius
northshore421c
Posts:2
Thank you very much for the assistance. Now I have another quagmire! I'm running a frequency oscillator on my site through javascript. Alas, I have one more issue that I need help with in order to complete my project. I'm using the countdown timer with pause and resume that you suggested, which is working perfectly on my site. I've looked at all the javascript mute/unmute scripts and they all seem to be wanting and "source SRC" in order to mute that file. Again I'm using the frequency oscillator.
Here is the script for the "Pause/Resume" that you gave me.
All I need it to be able to mute the tone generator when I press the timer Pause Button, then resume the tone when I press resume to co-inside with the timer. I've tried
Really I just want to mute and unmute the sound. Again Thanks so much in advance for the help!
Ray
Here is the script for the "Pause/Resume" that you gave me.
Code: Select all
function startPauseCT(){
if(parseInt(el_mns.value) >0 || parseInt(el_scs.value)>0 || endct ==1){
ctpause *=-1;
if(ctpause ==1){ //Start and set next click as Pause
el_btnct.value ='Pause';
window[obnm].countdownTimer();
}
else el_btnct.value ='Resume';
}
}
Code: Select all
function stop() {
oscillator.noteOff(0);
fire('stop');
}
Ray
Admin
Posts:805
I not know how the osillator /sound is muted and unmuted, but if you know and you want to combine that code with the script for the "Pause/Resume", add Unmute /start when ctpause is 1, and Mute /stop to "else" statement.
Code: Select all
function startPauseCT(){
if(parseInt(el_mns.value) >0 || parseInt(el_scs.value)>0 || endct ==1){
ctpause *=-1;
if(ctpause ==1){ //Start and set next click as Pause
el_btnct.value ='Pause';
//HERE ADD CODE FOR UNMUTE /START
window[obnm].countdownTimer();
}
else {
el_btnct.value ='Resume';
//HERE ADD CODE FOR MUTE /STOP
}
}
}
Similar Topics
- Hour and Minutes togheter in Javascript
JavaScript - jQuery - Ajax First post
Dear Coursesweb I can not find out how to add the hours + minutes togheter.Last post
<SCRIPT LANGUAGE= JavaScript >
day = new Date()
hr =...
See and use the following example:
<script>
var day = new Date();
let hr = day.getHours();
let mn = day.getMinutes();
let se =... - Display message to every minute in Javascript
JavaScript - jQuery - Ajax First post
Hello,Last post
On eatch minute from the current hour I wanna have an message
I can not find out how to complete
I hope to get something like this (code...
If you only want to display a message to every minute, just use the setInterval() function. It calls a function repeatedly, over and over again, at...