Coder Social home page Coder Social logo

jquery-simple-timer's Issues

Set data-seconds-left value using jquery on page load

Thanks for this plugin its really helpful. Can you please tell me how can I set the value using jquery of this below tag. I cannot give time to data-seconds-left with my h4 tag. Its remaining time is coming from the server-side. So, I need to assign it on page load.

Ie 11 not working

not working in ie 11. im getting this error

Object doesn't support property or method 'isInteger'

Add option to loop forever

Add option to repeat forever.

$('timer').startTimer({
  loop: true, // restarts timer after each time out
  loopInterval: 5, // waits 5 seconds before starting timer again
})

Any chance how to show days left?

Hi, thanks for your script - it is easy and working as expected. Only one thing I miss is posibble to show days left. I've tried to extend plugin but it is broken :) Would be fine to have this option.

Unable to re-set timer to different duration.

Hi, i tried using the timer with data-seconds-left =2 , after the 2 seconds run out, i run some ajax, after ajax returns, i want to run the timer with a 10 seconds duration.
Any idea on how to make this possible?
The timer seems to run back the 2 seconds timer even after i change the data-seconds-left to 10 seconds via $('#timer').attr('data-seconds-left',10);
Thanks.

timer pause and play

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.

StopTimer and clearInterval

Hi!!
I have a timer and i want a function to stop timer.

var inter = $(`#my-record-${id} .timer`).startTimer();

But the library don't have any function to stop.

Thanks

how to limit the number of timer loop?

Hi,
I want to specify the number of the timer loop! I can set the loop interval but I don't know how to limit the loop number?!
any idea?
thanks
Mansour

if data-minutes-left="0"

I use your Time as a Sun clock which counts down the seconds to sunset.

If the data-minutes-left="0"is set to 0 (which happens after sunset) there is nothing displayed anymore. Is it somehow possible to keep it in the 00:00:00 format?

Add clearInterval function to element

From this

$('.timer').startTimer({
  onComplete: function(element){
    clearInterval(element.intervalId);
    element.addClass('timeout');
  }
});

to this

$('.timer').startTimer({
  onComplete: function(element){
    element.clearInterval();
    element.addClass('timeout');
  }
});

"jQuery is not defined" when using the NPM installation method.

I followed the NPM installation method:

"use strict";
let $ = require("jquery");
require("jquery-simple-timer")($);

$(() => {
  $('.timer').startTimer();
});

and it says jQuery is not defined.

Not sure if this has something to do with the fact that Im transpiling ES6 code using babelify and browserify.

Note: The jQuery is not defined comes from the plugin file itself "jquery.simple.timer.js:189"

Thanks in advance!

Bump version

Bump version so that bower sees new features.

Jquery Timer is not working in IE browser

Hi Carlos,

I am using this code . It is not working in any version of IE. Although it works fine in all other browsers like Mozilla,Chrome and Safari. Could you provide any solution.

Thanks,
Deepak

Ho to debugg this?

I used your plugin severyl times but no it's not working anymore.

I load it like this:

<div class="sunLocDuration timer itIsDay" data-seconds-left="19999"></div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/caike/jQuery-Simple-Timer/1bc86823/jquery.simple.timer.js"></script>
<script>
  $( document ).ready(function() {
    $('.timer').startTimer();
  });
</script>

This does nothing. It doesnt even throw an error. It simply doesn't work. What's the catch here?

Add restart example to the docs.

Add example showing how to restart the timer from the onComplete function and with a new value for timeout. Mention the .attr() method will not work and we must use the .data() method instead. See #20

missed onComplete event when computer is asleep

Using Simple-Timer as an auto-logout for a private database I encountered an issue: e.g. the timer is set to 30', the computer goes to standby at 28' and is re-activated 4 minutes later, the timer is at 23h 58', having missed the onComplete event at 0'00''.
Inserting a new line 125
if (timeLeft < 0) timeLeft = 0;
did solve this for me.

Accept custom element classes via options.

Accept custom classes for span elements (hours, minutes, seconds and clearDiv) and for timeout via a classNames option. Like this:

  $('#timer').startTimer({
    classNames: {
      hours: 'banana-hours',
      minutes: 'banana-minutes',
      seconds: 'banana-seconds',
      clearDiv: 'banana-clearDiv',
      timeout: 'banana-timeout'
    }
  });

on almost complete

Is it possible to add an "on almost complete" to the mix so the counter gets other styles when the time is almost up?

how can i stop the timer

hi,excuse me , im working with your timer but i dont know how can i stop the timer ? please
thanks
sincerely

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.