<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="../js/jquery-3.6.1.js"></script>
<style>
#app_id {
width: 100px;
background-color: aqua;
height: 35px;
text-align: center;
line-height: 35px;
}
.stylediv {
background-color: yellow;
border-top: 1px solid #000;
}
</style>
</head>
<body>
<ul>
<li id="app_id" class="app_jd" name="show_hide">
abc
<div id="app_id_items" style="display: none;">
<div>dldl</div>
<div>ddd</div>
<div>dldl</div>
<div>ddd</div>
<div>dldl</div>
<div>ddd</div>
</div>
</li>
</ul>
<script>
showhide();
function showhide() {
//鼠标移入显示,移出隐藏
$('[name=show_hide]').hover(function() { //鼠标移入 显示 this是DOM对象
var id = this.id + "_items";
$("#" + id).children().addClass('stylediv')
$("#" + id).stop().slideDown(1000)
}, function() { //鼠标移出 隐藏
var id = this.id + "_items";
$("#" + id).children().addClass('stylediv')
$("#" + id).stop().slideUp(1000)
})
}
</script>
</body>
</html>
点击菜单 进行动画显示