Excellent Programming Tricks

setInterval VS setTimeout | JavaScript

  1. setInterval
    1. setInterval(funcName, delay)
    2. Repeat until manually break.
    3. var object = $('article:not(.reveal)');
      var i = 0;
      setInterval(function(){
             if( i >= object.length ) return false;
             alert('Hi');
             i++; 
         }, 200);
  2. setTimeout
    1. setTimeout(func, delay)
    2. Run only once.
    3. setTimeout(function(){
            that.removeClass('loading').find('.text').slideDown(320);   
      }, 1000);

No comments:

Post a Comment


Authentic аnd Excellent

Website

HTML Template

Wordpress Theme

Database applications

OR

Application services?

Excellent Programming Tricks (EPT) || Iftekhar-IT || We develops the Web applications and the WordPress templates. || Excellent Programming Tricks (EPT)

© 2020 Blogger Theme by Iftekhar IT || Excellent Programming Tricks

Execllent Programming Tricks. Powered by Blogger.