Yo ninjas, in this tutorial I want to teach to you the amazingness of JavaScript timers :). Timers are used all over the show in JavaScript, in anything from popup …

source

24 COMMENTS

  1. we usually call/fire functions by putting () at the end, right? like myFunction(). So can some1 explain, why we don't need to put () here —> setTimeout(showMessage, 3000); ?

  2. great video !! Thank you !
    I have a question , in the end of the demo, after storing the interval function into variable myTimer, you did not call the interval function ( only assigned variable to it) , but the color still changes after you refresh the page . can anyone tell me why?

  3. Let us say when you clicked on the color to stop the cycling, if you wanted your "Timer stopped" text to be in the middle of the color box how would you go about doing that?

  4. Great tutorials so far man, very helpful. I just have a question for the css portion here. where u have two paddings what does the second one represents? is the first one hight and second one from right. and also the margin, why u have 0 and auto. is zero for the top and auto for centring it?

LEAVE A REPLY

Please enter your comment!
Please enter your name here