Git Product home page Git Product logo

Comments (9)

jbrooksuk avatar jbrooksuk commented on June 3, 2024

Thanks @ortokore I'll take a look at this bug tonight 👍

from jquery-timer-plugin.

ortokore avatar ortokore commented on June 3, 2024

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.

jbrooksuk avatar jbrooksuk commented on June 3, 2024

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.

ortokore avatar ortokore commented on June 3, 2024

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.

ortokore avatar ortokore commented on June 3, 2024

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.

jbrooksuk avatar jbrooksuk commented on June 3, 2024

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.

jbrooksuk avatar jbrooksuk commented on June 3, 2024

So you're all done then @ortokore?

from jquery-timer-plugin.

ortokore avatar ortokore commented on June 3, 2024

yes

from jquery-timer-plugin.

jbrooksuk avatar jbrooksuk commented on June 3, 2024

Awesome :) thanks for using my plugin too!

from jquery-timer-plugin.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.