Skip to content

Pause/Resume #9

Description

@n3g

Hi,
First of all, great plugin! :)
I'm trying to use it with a pause/resume button, however I'm getting the same behavior with start() and resume(): they both resume with the time that has elapsed.
I'm using jquery 1.10.2 with the latest version of your plugin.
The code I have is:

var timer_paused = false;

function pause_resume_timer() {
    var tt = $('#timer').data('tinyTimer'); 

    if (timer_paused) {
        tt.resume();
        timer_paused = false;
    } else {
        tt.stop();
        timer_paused = true;
    }
    $("#pause_resume_icon").toggleClass("icon-pause icon-play");
}
...
<i onclick="pause_resume_timer()" id="pause_resume_icon" class="icon-pause"></i><span id="timer" style="position: absolute; position: relative; left: -68px;"></span>

Any help is appreciated :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions