버튼을 가져갈 때 상자를 움직이는 함수가 있습니다. 마우스가 버튼 위로 움직이는 한, 매초마다 반복적으로 실행하는 기능을 원합니다. 나는 루프도 시도했지만 이것을 작동시킬 수는 없다. 나는 당신이 이것을 들여다 볼 수 있다면 매우 감사 할 것입니다.javascript 함수를 여러 번 실행 onmouseover
<!DOCTYPE html>
<head>
<style>
#box {
position: relative;
top: 20px;
left: 10px;
width: 50px;
height: 50px;
background:#333366;
}
</style>
<script>
function Start() {
setInterval(Move('box'),1000);
}
var value = 0;
function Move(element) {
value += 50;
var box = document.getElementById(element);
box.style.transition = "left 0.2s ease-in-out 0s";
box.style.left = value+'px';
}
</script>
</head>
<body>
<button onmouseover="Start();">Hover to move</button>
<div id="box"></div>
</body>
</html>
당신이 원하는 결과와 당신이로 실행 중이거나 사람들이 당신에게 당신이 정말로 찾고있는 대답을하지 않을 수 있습니다 실제 문제를 설명해야한다. – Shaded