Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timer pause and play #29

Closed
sayan0020 opened this issue Jun 14, 2017 · 2 comments
Closed

timer pause and play #29

sayan0020 opened this issue Jun 14, 2017 · 2 comments

Comments

@sayan0020
Copy link

how to pause the timer by clicking on some button without clicking on the timer ? I've tried all the suggestion you gave and from the previous issues solved. But it didn't help me out. Please response ASAP.

@findelallc
Copy link

findelallc commented Jun 16, 2017

Hope what your are asking I can help you in some sort like this

var time_event_flag = 0; function start_timer() { if(!time_event_flag) { $("#mock-time-left").startTimer({ allowPause: true }); } else { $("#mock-time-left").trigger("click"); } } function stop_timer() { $("#mock-time-left").trigger("click"); time_event_flag = true; }

@caike
Copy link
Owner

caike commented Jun 16, 2017

Assuming you have button like

<button id="button-pause">Pause/Resume</button>

You could do something like this

const timer = $('.timer-pause');
timer.startTimer({
  allowPause: true
});

$("#button-pause").on("click", () => timer.trigger("click"));

And that should work!

@caike caike closed this as completed Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants