码迷,mamicode.com
首页 > Web开发 > 详细

第一次来博客园先用jquery写一个简单菜单收缩效果

时间:2014-07-10 16:28:26      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   width   cti   io   

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="jquery-1.7.2.min.js"></script>
    <style>
        div, ul, li{margin:0px;padding:0px;list-style-type:none;}
        #menu{width:120px;margin:0px auto;text-align:center;}
        .menuItem{font-size:16px;font-weight:900;border:1px solid red;cursor:pointer;}
        .subMenu{display:none;opacity:0;}
        .subItem{font-size:14px;font-weight:normal;}
    </style>
    <script>
        $(function () {
            $(".subItem:even").css("background-Color", "#ddd");
            $(".menuItem").hover(function () {
                $(this).children().stop().animate({ opacity: 1.0,height:‘show‘ });
            }, function () {
                $(this).children().stop().animate({ opacity: 0, height: ‘hide‘ });
            });
        });

    </script>
</head>
<body>
    <div style="margin:40px auto;">
        <ul id="menu">
            <li class="menuItem">
                greens
                <ul class="subMenu">
                    <li class="subItem">Chinesecabbage</li>
                    <li class="subItem">potato</li>
                    <li class="subItem">tomato</li>
                </ul>

            </li>

        </ul>

    </div>
</body>
</html>

第一次来博客园先用jquery写一个简单菜单收缩效果,布布扣,bubuko.com

第一次来博客园先用jquery写一个简单菜单收缩效果

标签:style   http   color   width   cti   io   

原文地址:http://www.cnblogs.com/xuyafang/p/3834917.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!