Make color animation in a title

0

I need to make an animation title that changes color after a certain time, then return to the original color, and keep changing between two colors indefinitely.

    
asked by Camilo 15.03.2017 в 04:26
source

1 answer

1

In addition to jQuery, you need to add jQueryUI to your web in the head or add this library to animate colors:

<script src="//cdn.jsdelivr.net/jquery.color-animation/1/mainfile"></script>

Then in JQuery:

$(document).ready(function()
{
  animateForever();
});

function animateForever()
{
  var div = $('h1');
  var color1 = '#A333FF';
  var color2 = '#3BD6C6';

  div.animate({color: color1}, 1000, function()
  {
    div.animate({color: color2}, 1000, function()
    {
      animateForever();
    });
  });
}

I'll leave you a Plunker so you can see it: link

    
answered by 15.03.2017 в 05:07