为什么回调函数在函数执行完成后不立刻执行,还需要再次鼠标经过div。(运动框架省略)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
#div1{
position: absolute;
width: 100px;
height: 100px;
background: red;
top: 60px;
}
</style>
</head>
<script src="Move.js"></script>
<script>
window.onload=function(){
var div=document.getElementById('div1');
div.onmouseover=function(){
startMove(this,{top:0},function(){
startMove(div,{top:60});
});
}
}
</script>
<body>
<div id="div1"></div>
</body>
</html>