event对象之与onmouse相关的事件触发

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>与mouse相关的事件触发</title>
<style type="text/css">
div{
background-color: #1ecc86;
width:100px;
height: 200px;
}
</style>
</head>
<body>
<div onmousedown="down()" onmouseout="out()" onmouseover="over()" onmousemove="move()">div1</div>
<script>
//
//
function down() {
console.log('down');
}
function out() {
console.log('out');
}
function move() {
console.log('move')
}
function over() {
console.log('over');


}
</script>

</body>
</html>
posted @ 2020-02-03 22:03  Stary_tx  阅读(272)  评论(0编辑  收藏  举报