*{ padding: 0; margin: 0; }
html,body{
height: 100%; width: 100%;
}
.graph {
position: relative; height: 0px;
margin: 300px auto; border-top: solid 1px gainsboro;
}
.point{
position: absolute; width: 1px; height: 1px; background: black;
}
var degree = 0;
setInterval(function(){
var radian = degree * (Math.PI/180);
var div = document.createElement("div");
div.className = "point";
div.style.left = degree+"px";
div.style.top = -100 * Math.sin(radian)+"px";
graph.appendChild(div);
degree += 1;
},30);
一键复制
编辑
Web IDE
原始数据
按行查看
历史