<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>图片跟着鼠标走</title>
<script type="text/javascript">
window.onload = function () {
var div = document.getElementById("divFly");
document.onmousemove = function DivFlying(ev) {
if (!div) {
return;
}
var Event = ev || event;
div.style.top = Event.clientY + 'px'; //Y
div.style.left = Event.clientX + 'px';//X
};
};
</script>
</head>
<body>
<div id="divFly" style="position:absolute;">
<img src="../../../收藏的picture/animals/lovely cats/1.jpg" /><br />
</div>
</body>
</html>
qq_简笔_0
相关分类