jq实现简单的二级动画导航

Original 2019-05-27 18:22:13 297
abstract:<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>二级导航动画实现</title>    <script type=&quo

<!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>

Correcting teacher:天蓬老师Correction time:2019-05-28 16:01:39
Teacher's summary:jQuery中的动画 , 实现起来非常的方便, 但也有一些不错的第三方动画 库更强大, 可以了解一下

Release Notes

Popular Entries