Website Countdown js


Ask A Question





Login To post a question

Hi I am having a hard time making this countdown work for me. I am trying to make it count down to every sunday at 11:15am since that is when our church service starts. Can anyone pleaes help me? I have the code here.


function croAnim(){ 

    // IF THERE'S A COUNTDOWN
    if ($('ul.cro_timervalue').length !== 0) {


        // GET ALL THE INSTANCES OF THE TIMER
        $('ul.cro_timervalue').each(function() {

            var $this       = $(this),
                timesets    = $this.data('cro-countdownvalue'),               
                now         = new Date(),
                tset        = Math.floor(now / 1000),
                counter1    = timesets - tset;


            // CALCULATE SECONDS
            var seconds1    = Math.floor(counter1 % 60);  
                seconds1    = (seconds1 < 10 && seconds1 >= 0) ? '0'+ seconds1 : seconds1;


            // CALCULATE MINUTES                
            counter1        =counter1/60;
            var minutes1    =Math.floor(counter1 % 60);
            minutes1        = (minutes1 < 10 && minutes1 >= 0) ? '0'+ minutes1 : minutes1;


            // CALCULATE HOURS
            counter1=counter1/60;
            var hours1=Math.floor(counter1 % 24);
            hours1 = (hours1 < 10 && hours1 >= 0) ? '0'+ hours1 : hours1;


            // CALCULATE DAYS
            counter1    =counter1/24;
            var days1   =Math.floor(counter1);
            days1       = (days1 < 10 && days1 >= 0) ? '0'+ days1 : days1;



            // ADD THE VALUES TO THE CORRECT DIVS
            $this.find('span.secondnumber').html(seconds1);
            $this.find('span.minutenumber').html(minutes1);
            $this.find('span.hournumber').html(hours1);
            $this.find('span.daynumber').html(days1); 


        });
    }
}


// CREATE A INTERVAL FOR THE TIMER
croInit = setInterval(croAnim, 100);

For more info please click herehttps://stackoverflow.com/q/26922766



Have a question or need a custom quote?
info@smartinfocare.com