.a {
width:600px;
height:600px;
background:#cffdf;
margin:20px auto;
position:relative;
display:flex;
justify-content:center;
align-items:center;
flex-flow:column nowrap;
}
.b {
width:30px;
height:30px;
border-radius:50%;
background:red;
position:absolute;
}
.a .img {
display:inline-block;
width:120px;
height:120px;
}
.a .row {
display:flex;
justify-content:center;
align-items:center;
flex-flow:row nowrap;
}
.center {
display:flex;
justify-content:center;
align-items:center;
flex-flow:row nowrap;
}
.cenc {
display:flex;
justify-content:center;
align-items:center;
flex-flow:column nowrap;
}
.cenregion {
width:340px;
height:340px;
margin:9px;
border:1px solid #ccc;
border-radius:3px;
}
点击开始按钮可以生成多个位置随机范围内的小球,在设置的时间后自动按照动画轨迹转动,减速,停止
**js代码里面轨迹描述的方法是在网上借鉴过来的