<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
#menu{
position: relative;
width: 100px;
height: 36px;
}
#menu h3{
height: 36px;
padding: 0;
margin: 0;
font-size: 20px;
}
#box{
position: absolute;
top: 36px;
width: 120px;
height: 120px;
left: -12px;
background: #c00;
display: none;
}
</style>
<script src="js/jquery-3.3.1.js" type="text/javascript" charset="UTF-8"></script>
<!--声明js代码域-->
<script type="text/javascript">
function showmenu() {
var box = document.getElementById("box");
box.style.display = "block";
}
function hidemenu() {
var box = document.getElementById("box");
box.style.display = "none";
}
</script>
</head>
<body>
<div id="menu" onmouseover="showmenu()" onmouseout="hidemenu()">
<h3>下拉菜单</h3>
<div id="box"></div>
</div>
</body>
</html>
————鼠标滑过文字