XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
Countdown Timer https://www.bbs.xwidget.com/viewtopic.php?f=8&t=6737 |
Page 1 of 1 |
Author: | Stoniee [ June 24th, 2017, 8:33 am ] |
Post subject: | Countdown Timer |
Hi i wants to make a timer where i can type 3.00.0 and it wil go dow to zero and go back to 2.59.59 and a start and stop buttom can anybody help /Stonie |
Author: | Jimking [ June 24th, 2017, 11:24 am ] |
Post subject: | Re: Countdown Timer |
Stonie if I remember well there is a timer widget posted on DA. I don't know if you can find any similar one in the official gallery. I will search and if I find something I will post the link here |
Author: | Stoniee [ June 25th, 2017, 11:56 am ] |
Post subject: | Re: Countdown Timer |
Thx Jimking |
Author: | Jimking [ June 25th, 2017, 1:49 pm ] |
Post subject: | Re: Countdown Timer |
I found this for now: http://www.kuyuapp.com/xwidget/widgets/ ... 18/52.html It's a Countdown Timer widget but for days only.. Send a pm to this guy and ask if he knows something.. http://kjc66.deviantart.com/ |
Author: | Stoniee [ June 26th, 2017, 12:08 pm ] |
Post subject: | Re: Countdown Timer |
thx and i will |
Author: | digigamer [ June 27th, 2017, 11:39 pm ] |
Post subject: | Re: Countdown Timer |
Code: var Countdown = new function(mins, seconds, done) { this.timeLeft = mins * 60 + seconds; this.done = done; } Countdown.prototype.start = function () { var self = this; var down = function () { this.countdown--; if(self.timeLeft > 0) { self.counter = setTimeout(down, 1000); } else { self.done(); } }; } Countdown.prototype.pause = function () { if ( this.counter) { clearTimeout(this.counter); } } Countdown.prototype.reset = function () { this.timeLeft = 0; if ( this.counter) { clearTimeout(this.counter); } } Use it like this: Code: // global var c; // in widget create var c = new Countdown(minutes, seconds); // on start c.start(); // pause c.pause(); //reset c.reset(); // on stop |
Author: | yereverluvinuncleber [ June 28th, 2017, 12:16 am ] |
Post subject: | Re: Countdown Timer |
Steady on Digigamer, or people will start to use Xwidget for real javascript development! ![]() |
Author: | Stoniee [ June 28th, 2017, 10:11 am ] |
Post subject: | Re: Countdown Timer |
Thx alot it runs but how can i make a display for the counter to show numbers sorry for being a noob ![]() |
Author: | yereverluvinuncleber [ June 28th, 2017, 10:22 am ] |
Post subject: | Re: Countdown Timer |
Well dear chap, as this is a javascript engine it will be hard to answer your queries without some relation to javascript. https://stackoverflow.com/questions/20618355/the-simplest-possible-javascript-countdown-timer Digigamer's answer and the above link is the sort of answer you will receive here. Both replies would assist us. Bar us creating a widget for you your only recourse is to search through the widgets that exists in the gallery and look for one that fits, then look into making changes so it will do what you want. |
Author: | Stoniee [ June 28th, 2017, 10:27 am ] |
Post subject: | Re: Countdown Timer |
ahh okay so i guess this is the wrong place to get help for understanding the script sorry im a noob |
Author: | yereverluvinuncleber [ June 28th, 2017, 11:34 am ] |
Post subject: | Re: Countdown Timer |
No, its the right place but the trouble is the answers might be a bit complex for you to take. Find a countdown widget, see how it is built and get used to the idea of Xwidget cores and how they operate, then look at some widgets with javascript and see if you can get a handle on how it does what it does, I have a stopwatch widget that might be interesting but it could also overwhelm you. http://yereverluvinuncleber.deviantart.com/art/Panzer-Clock-and-Stopwatch-XWidget-593451692 This programming stuff isn't easy and even though javascript/Xwidgets is at the easiest end of it, it still requires knowledge of xwidget cores or javascript techniques. |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |