jquery 让图片飞
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$(document).mousemove(function (e) {
$('#img').css('position', 'absolute').css({ "left": e.pageX, "top": e.pageY });
})
})
</script>
</head>
<body>
<img src="1.jpg" id="img" />
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$(document).mousemove(function (e) {
$('#img').css('position', 'absolute').css({ "left": e.pageX, "top": e.pageY });
})
})
</script>
</head>
<body>
<img src="1.jpg" id="img" />
</body>
</html>