Skip to content

Instantly share code, notes, and snippets.

@albertodelax
Created August 5, 2015 17:09
Show Gist options
  • Save albertodelax/856e67e9ba5905c051db to your computer and use it in GitHub Desktop.
Save albertodelax/856e67e9ba5905c051db to your computer and use it in GitHub Desktop.
Rainbow Background Animation
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
body {
background-color: red;
transition: background-color 7s;
}
</style>
</head>
<body>
<script type="text/javascript">
var colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"];
var i = 1;
window.setInterval(function(){
document.body.style.backgroundColor = colors[i];
i++;
if (i === colors.length){
i=0;
}
}, 5000);
</script>
</body>
</html>
@ddsifghsudfyvghsdfv
Copy link

hw do i use it

@ddsifghsudfyvghsdfv
Copy link

@ddsifghsudfyvghsdfv
Copy link

ya how do i use it

@haininj
Copy link

haininj commented Dec 2, 2021 via email

@ddsifghsudfyvghsdfv
Copy link

what

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