Comments (9)
Thanks @ortokore I'll take a look at this bug tonight 👍
from jquery-timer-plugin.
great! could it be that since the timer is being created on 'this', if I try to stop it from 'somewhere else' (out of scope) it just doesn't find/recognize the timer itself? hahaha kinda complicated. I come from an ActionScript background and that scope issue is usually the case with the setIntervals
from jquery-timer-plugin.
Do you mind writing pseudo script to explain that? It's about time it was updated anyway, so it'd be nice getting in features that people actually need :)
from jquery-timer-plugin.
ok -- this is what I'm using to start up the timer:
var tiempo = $.timer(function(nivel) {
// some actions
});
tiempo.once(30000);
So this starts up the timer to run once for 30 seconds, then do some actions.
The problem is that if I want to stop the timer before the 30 seconds so those actions don't take place, the timer just keeps on going.
I've tried using the stop();
and stop("tiempo")
to no avail.. also tried using the reset()
function, but just doesn't wanna do it.. .any clues would be very helpful!!
from jquery-timer-plugin.
Ok, nailed it!! on the once() method/function the setTimeout
wasn't referenced to the timeoutObject
, which is the var that clearTimer
clears. So now the once function looks like this:
this.once = function(time) {
var timer = this;
if(isNaN(time)) {time = 0;}
this.timeoutObject = window.setTimeout(function() {timer.action();}, time);
return this;
};
thanks a bunch! :D
from jquery-timer-plugin.
Awesome, I'll get this implemented either today or over the weekend. I'll let you know when it's done :)
from jquery-timer-plugin.
So you're all done then @ortokore?
from jquery-timer-plugin.
yes
from jquery-timer-plugin.
Awesome :) thanks for using my plugin too!
from jquery-timer-plugin.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-timer-plugin.