为了账号安全,请及时绑定邮箱和手机立即绑定

菜单的动画效果出不来呀??是不是script语句写的有问题,帮我看看,谢谢了

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            .top-nav{
                list-style: none;
                font-size: 14px;
                font-weight: bold;
            }
            .top-nav li{
                float: left;
                margin-right: 3px;
            }
            .top-nav li a{
                text-decoration: none;
                background-color: #EEEEEE;
                color: #666666;
                width: 90px;
                text-align: center;
                display: block;
                line-height: 40px;
            }
            .top-nav ul{
                display: none; 
                list-style: none;
                padding: 0;    
                position: absolute;
             }
             .top-nav li a:hover{
                 background: url(img/ss1.png)0 0 repeat-x;
             }
            .top-nav li:hover ul{
                width: 90px;
                display: block;
                padding: 0;
            }
            .top-nav li ul:hover li{
                display: block;
            }
            .note{
                background-color: #EEEEEE;
                display: block;
                background: url(img/ss1.png)0 0 repeat-x;
            }
        </style>
    <script type="text/javascript" src="js/jquery-3.1.1.js" ></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $(".top-nav li").mousemove(function(){
                $(this).find("ul").slideDown("1000");
            });
            $(".top-nav li").mouseleave(function(){
                $(this).find("ul").slideUp("slow");
            });
        });
    </script>
    </head>
    <body>
        <ul class="top-nav">
                <li>
                    <a href=""><span class="note">首页</span></a>
                </li>
                <li>
                    <a href="">日志</a>
                    <ul>
                        <li>
                            <a href="">加油</a>
                        </li>
                        <li>
                            <a href="">努力</a>
                        </li>
                        <li>
                            <a href="">安静</a>
                        </li>
                        <li>
                            <a href="">速度</a>
                        </li>
                    </ul>
                </li>
                <li class="navmenu">
                    <a href="">相册</a>
                    <ul>
                        <li>
                            <a href="">加油</a>
                        </li>
                        <li>
                            <a href="">努力</a>
                        </li>
                        <li>
                            <a href="">安静</a>
                        </li>
                        <li>
                            <a href="">速度</a>
                        </li>
                    </ul>    
                </li>
                <li class="navmenu">
                    <a href="">音乐盒</a>
                    <ul>
                        <li>
                            <a href="">十年</a>
                        </li>
                        <li>
                            <a href="">红玫瑰</a>
                        </li>
                        <li>
                            <a href="">淘汰</a>
                        </li>
                        <li>
                            <a href="">约定</a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="">关于我们</a>
                </li>
            </ul>
    </body>
</html>


正在回答

3 回答

你的jQuery文件引进正确不,好好检查一下

0 回复 有任何疑惑可以回复我~

我的也是没有处理效果,可能是我们的jQuer包版本高了。

0 回复 有任何疑惑可以回复我~

有效果啊,jq引用地址正确吗

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
形形色色的下拉菜单
  • 参与学习       106972    人
  • 解答问题       543    个

本教程从易到难,循循渐进,运用不同技术实现动态下拉菜单

进入课程

菜单的动画效果出不来呀??是不是script语句写的有问题,帮我看看,谢谢了

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信