0 Replies Latest reply on Nov 11, 2014 11:19 AM by thatguysketch

    Create a Flip-Counter

    thatguysketch

      Hey, im trying to recreate a flip counter like this:

       

      Capture.PNG

       

      I'm just starting out so right now so all i have is this counter code for a text box with the id of "Text":

       

      var counter_delay = 20;

      var max_count = 2000;

      var present_count = 489;

       

       

      var timer = window.setInterval(stepUp, counter_delay);

      var timer = window.setInterval(stepUp2, counter_delay);

       

       

      function stepUp() {

           present_count++;

           // Change the text of an element

           sym.$("Text").html(present_count);

       

       

           if (present_count >= 2000) {

                present_count = 0; // resets the count to 0

           }

       

       

       

       

      }

       

       

      Can anyone help or point me in the right direction to achieve this?