Guest User

Untitled

a guest
Jan 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. $("button").each(function(index){
  2. // add the class
  3. setTimeout(function(){
  4. $(this).addClass("varrimento");
  5. }.bind(this),index*5000);
  6. // remove the class
  7. setTimeout(function(){
  8. $(this).removeClass("varrimento");
  9. }.bind(this),(index+1)*5000);
  10. });
  11.  
  12. var timerId = setInterval(function () {
  13. //Faz alguma coisa aqui!
  14. if(condicao == true){
  15. //Termina a execução
  16. clearInterval(timerId);
  17. }
  18. },5000);
Add Comment
Please, Sign In to add comment