"Background Color Changing "
Bootstrap 3.0.0 Snippet by vara24

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!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 = ["#FF3547", "#ff1744", "#ffa726", "#eeff41", "#00C851", "#40c4ff", "#8c9eff", "violet"];
var i = 1;
window.setInterval(function(){
document.body.style.backgroundColor = colors[i];
i++;
if (i === colors.length){
i=0;
}
}, 5000);
</script>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: