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!

Leave a Reply

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