var innermost = 15; var start = 30; var growth = 1.2; var radius = innermost; for (var i = 0; radius < Math.min(window.innerWidth, window.innerHeight)/2; ++i) { e = document.createElement("div"); e.className = "circle"; e.style.height = (2*radius) + "px"; e.style.width = (2*radius) + "px"; document.getElementById("circles").appendChild(e); radius += start * Math.pow(growth, i); } /* document.getElementsByClassName("light")[0].animate( [ { top: "50%", left: "50%" }, { top: "50%", left: "50%", offset: 0.9 }, { top: "50%", left: "50%" } ], { duration: 10000, iterations: Infinity } );*/