<html>
<head>
<title></title>
<script type="text/javascript">
document.onmousemove = function () {
var x = window.event.clientX;
var y = window.event.clientY;
var divFly = document.getElementById("divFly");
if (!divFly) {//判断图片是否加载完了,如果没加载
return;
}
divFly.style.left = x;
divFly.style.top = y;
};
</script>
</head>
<body>
<div id="divFly" style=" position:absolute">
<img src="Images/cry.gif" /><br />
你欺负我~
</div>
</body>
</html>
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)