<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<title>requestAnimationFrame Test</title>
<style type="text/css">
html, body {
height: 100%;
padding: 0px;
margin: 0px;
}
#container {
width: 100%;
height: 100%;
background: rgb(128, 128, 128);
}
</style>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
var container = document.getElementById('container');
var c = 128;
tick();
function tick() {
++c;
c %= 256;
container.style.backgroundColor = "rgb("+c+","+c+","+c+")";
requestAnimationFrame(tick);
};
</script>
</body>
</html>