When the timer expires

1

Good morning, I have a question that I have been working on for some time. I have 1 countdown timer, when the timer reaches 0, I want invisible buttons to be visible. I'm using Meteor JS with the following package: link

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();
    },
})
    
asked by anonymous 18.05.2018 / 13:44

1 answer

0

I was able to use 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) 
    
22.05.2018 / 11:27