How to setInterval effect with JavaScript

Use the JavaScript setInverval function to create a cool effect

I'm going to use jQuery to create the animation using fadeIn and fadeOut functions.

function my_effect() {

/* Do something here */

/* Set the function and the time */
setInterval(my_effect(), 2000);


/*Call the function. Then it will start after loading the page */

Full Code

Example 16 | CodeGround

Hello World!

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.