Display Alphabets by setInterval() Function



     This page is built based on one and half year old tiny person's idea. My son AARON loves reading alphabets. I thought I could show alphabets one by one with a time interval and of course with bigger fonts. I used setInterval() function to write a little script to make him happy.
     var alphBtID;
     var alphBtsCount = 0;
     var alphBts = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
     function alphBtsStart() {
       if (alphBtID) {
         clearInterval(alphBtID);
       }
       alphBtID = setInterval(function () {
         document.getElementById("alphBtsPanel").innerHTML = alphBts.charAt(alphBtsCount);
         alphBtsCount++;
       }, 2500);
     };

No comments:

Post a Comment

Grab The Button...

Grab the above button and add to your blog or website to get easy access to Virtual Species. Simply click the textbox, copy the code and paste where you want to see the button. That's it!