<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1</title>
<script>
window.addEventListener('load',function(){
let tp=document.querySelector("#tp")
tp.addEventListener('mouseover',function(){
move()
})
function move(){
document.getElementById('tp').style.top=Math.random()*400+"px";
document.getElementById('tp').style.left=Math.random()*400+"px";
return;
setTimeout(move(),1000);
}
})
</script>
<style>
#tp{
position: absolute;
width: 500px;
height: 500px;
}
#tp1 img{
width:100%;
height: 100%;
}
</style>
</head>
<body>
<div id="tp" >
<div id="tp1">
<img src="../img/10.25图片.jpg" >
</div>
</div>
</body>
</html>