点击按钮让圆移动
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.box {
width: 150px;
height: 150px;
background: skyblue;
position: absolute;
left: 10px;
top: 50px;
border-radius: 50%;
}
</style>
</head>
<body>
<button class="btn-r">向右移动</button>
<button class="btn-l">向左移动</button>
<button class="btn-stop">停止</button>
<div class="box"></div>
<script>
var box = document.querySelector('.box');
var t;
document.querySelector('.btn-r').onclick = function () {
clearInterval(t);
t=setInterval(moveHor, 20,10);
};
document.