1. 程式人生 > >js 實現定時操作

js 實現定時操作

1.使用setInterval        

        a.設定操作的時間間隔

        setInterval(checkExpired, 10*1000);//10秒鐘檢查一次,是否超時
         

        b.清空本次的定時

        clearInterval(_interval_handler);

 

2.使用setTimeOut

       setTimeout(function(){ $('.am-progress-bar').parent().fadeOut(); },500);