<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>二级导航动画实现</title>
<script type="text/javascript" src="../jquery-3.4.1.min.js"></script>
<style>
*{margin: 0px;padding: 0px}
.menu{width: 800px;height: 35px;margin: 0px auto;background: grey;margin-top: 20px;color: black;border: 1px solid pink;border-radius: 5px}
ul{list-style-type: none}
ul li{width: 100px;height: 35px;line-height: 35px;text-align: center;float: left;border-right: 1px solid orange;cursor: pointer}
.two li{width: 100px;height: 35px;line-height: 30px;background: grey;color: black;font-size: 14px;position: relative;border: 0px}
.one li:hover{background: orangered;border-bottom: 1px solid white}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('.two').hide();
$('.one>li').mouseover(function () {
$(this).find('.two').slideDown(700);
});
$('.one>li').mouseleave(function () {
$(this).find('.two').slideUp(700)
})
})
</script>
</head>
<body>
<div class="menu">
<ul class="one">
<li>首页</li>
<li>软件入门
<ul class="two">
<li>PS</li>
<li>pr</li>
<li>AE</li>
<li>AI</li>
<li>word</li>
</ul>
</li>
<li>设计教程</li>
<li>职业办公</li>
<li>练习与实战
<ul class="two">
<li>每周一练</li>
<li>每周两练</li>
<li>项目实战</li>
</ul>
</li>
<li>分类VIP</li>
<li>直播公开课</li>
</ul>
</div>
</body>
</html>