<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/*给盒子设置宽高和背景颜色*、
div{width: 200px;height: 200px;background-color: blueviolet;}
</style>
</head>
<body>
<div>
/* 给div盒子里面的p标签设置宽高 */
<p style="width: 80px;height: 80px;background-color: burlywood;"></p>
</div>
<script src="./jquery-1.12.4.js"></script>
<script>
$('div').mouseover(function(){
console.log('mouseover鼠标指针移过时');
})
$('div').mouseout(function(){
console.log('mouseout鼠标指针移出时');
})
$('div').mouseenter(function(){
console.log('mouseenter鼠标指针进入时');
})
$('div').mouseleave(function(){
console.log('mouseleave鼠标指针离开时');
})
$('div').hover(function(){
console.log('鼠标移入')
},function(){
console.log('鼠标移出')
})
</script>
</body>
</html>