Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

244
Vistas
easytimer.js restart timer when page refresh or open new window

Good day! Could somebody suggest please.. I am using for record time easytimer.js plugin.

I have a button on the page where there is timer starts when I click it. But the problem is if

someone reloads the page or open new window the timer restarts. I dont know how to use local

storage to make sure my timer does not reset upon reload.

initTimer: function (){

        $(".timer").draggable({
            containment: "window",
            scroll: false,
            cursor: "move"
        });

        var timer = new easytimer.Timer();

       
        $('.timerDetails .startButton').click(function () {
            timer.start();

            //localStorage.setItem('timer', timer);

            $(".timer").css("display", "flex");
            $(".startButton").parent().children().removeClass("active");
            $(".startButton").addClass("active");*/

        });

        $('.timerDetails .pauseButton').click(function () {
            timer.pause();
            $(".pauseButton").parent().children().removeClass("active");
            $(".pauseButton").addClass("active");
        });

        $('.timerDetails .stopButton').click(function () {
            timer.pause();
            $(".stopButton").parent().children().removeClass("active");
            $(".stopButton").addClass("active");

        });


        timer.addEventListener('secondsUpdated', function (e) {
            $('.timerDetails .timer-values').html(timer.getTimeValues().toString());
        });

        timer.addEventListener('started', function (e) {
            $('.timerDetails .timer-values').html(timer.getTimeValues().toString());

        });

        timer.addEventListener('reset', function (e) {
            $('.timerDetails timer-values').html(timer.getTimeValues().toString());
        });

},
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda