Bensirpent07

animate.js

Feb 5th, 2016
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.40 KB | None
  1. // JavaScript Document
  2. $(document).ready(function(){
  3.     color = 'red';
  4.     window.setInterval(function(){
  5.         if(color == 'red'){
  6.             $('div#testing').animate({'background-color': 'blue'}, 'fast', 'easeOutQuint');
  7.             color = 'blue';
  8.         }
  9.         else if(color == 'blue'){
  10.             $('div#testing').animate({'background-color': 'red'}, 'fast', 'easeOutQuint'); 
  11.             color = 'red';
  12.         }
  13.         console.log(color);
  14.     }, 5000);
  15. });
RAW Paste Data Copied