When the timer ends

Asked

Viewed 65 times

1

Good morning, I have a question I’ve been working on for some time. I have a countdown timer, when the timer reaches 0, I want some invisible buttons to be visible. I’m using Meteor JS with the following package: https://atmospherejs.com/flyandi/reactive-countdown

E tenho o seguinte código:


  var countdown1 = new ReactiveCountdown(10, {
    interval: 500,
        complete: function() {
            var button1= document.getElementById("startMission1")
            button1.style.display='none'},
        });

Template.tabernaMission.events({
'click #startMission1': function(event) {
        countdown1.start(function() {
    });
})

Template.tabernaMission.helpers({
 getCountdown1: function() {
        return countdown1.get();
    },
})
  • What would be the problem? What would not be working?

  • the problem is that when the timer reaches 0 I want the buttons to become visible, and I’m not getting

  • because this is my problem not entering the function, yes the boots are with display None

  • If you can provide the minimum code so I can play here. I tried the plugin page but could not implement.

  • edited, available all the code I have

  • I am using Meteor, Blaze.js and a package

  • Already looked on the console if any error appears?

  • yes, and there’s no mistake

Show 3 more comments

1 answer

0


I managed using Settimeout

setTimeout(() => {
        var disableButton1 = document.getElementById("startMission1")
        var disableButton2 = document.getElementById("startMission2")
        var disableButton3 = document.getElementById("startMission3")

        disableButton1.style.display='block'
        disableButton2.style.display='block'
        disableButton3.style.display='block'
 }, 50000) 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.