<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
font-family: "Microsoft YaHei", serif;
}
body, dl, dd, p, h1, h2, h3, h4, h5, h6 {
margin: 0;
}
ol, ul, li {
margin: 0;
padding: 0;
list-style: none;
}
img {
border: none
}
#wrap{
width: 150px;
height: 150px;
background-color: #8CC1DE;
cursor: pointer;
user-select: none;
}
</style>
</head>
<body>
<div id="wrap"></div>
<script>
let oWrap = document.getElementById("wrap");
// 鼠标移入移出事件 移入移出子元素也算 所以不用
// onmouseover
// onmouseout
// 移入移出一般用
// onmouseenter
// onmouseleave
// 鼠标按下事件
// oWrap.onmousedown
// 鼠标移动
// oWrap.onmousemove
// 鼠标抬起
// oWrap.onmouseup
oWrap.onmousedown = function(){
console.log("down");
this.onmousemove = function(){
console.log("move");
};
};
oWrap.onmouseup = function(){
console.log("up");
this.onmousemove = null;
};
</script>
</body>
</html>
Python3Turtle