Skip to content

Instantly share code, notes, and snippets.

@romreed
Created April 30, 2016 06:13
Show Gist options
  • Save romreed/bf6260a855f64ee8dc4682fc0ac4605c to your computer and use it in GitHub Desktop.
Save romreed/bf6260a855f64ee8dc4682fc0ac4605c to your computer and use it in GitHub Desktop.
Section bg color cycling
// Section bg color cycling
$('.animated-bg').each(function(){
var $this = $(this),
colors = ['#ec008c', '#00bcc3', '#5fb26a', '#fc7331'];
setInterval(function(){
var color = colors.shift();
colors.push(color);
$this.animate({backgroundColor: color}, 2000);
},4000);
});
<div id="footerwrap" class="purple animated-bg stopsticky" style="background-color: rgb(236, 0, 140);">
</div>
@shamimsdp
Copy link

Is this code working? i'm tried it but it wouldn't work. have a look of it
https://codepen.io/shamim539/pen/zwwWGW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment