JQuery Study Notes— A small demo for Smooth Animated Menu

來源:互聯網
上載者:User

標籤:jquery   javascript   menu   css   

1. Before expanding:


2.  coding:

<!DOCTYPE html><html><head>    <title>Smooth Animated Menu</title>    <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script>    <script src="js/jquery.easing.1.3.js"></script>    <style>        body {            background-color: #F3F3F3;            font-family: "Lucida Grande", arial, sans-serif;        }        a{            text-decoration:none;                     color:#fff;        }        ul {            /*width: 500px; Don't add properties of width and height to 'ul'            height: 50px;*/        }        li {            width: 100px;            height: 50px;            text-align: center;            /*padding-top: 10px;*/            float: left;            overflow: hidden;        }        p{            padding:0px 5px;                    }        .subText {            color: #191919;            padding-top: 15px;        }        .green {            background: #649e37 url("images/green-item-bg.jpg") no-repeat right top;        }        .yellow {            background: #fbc701 url("images/yellow-item-bg.jpg") no-repeat right top;        }        .red {            background: #c61e01 url("images/red-item-bg.jpg") no-repeat right top;        }        .blue {            background: #008cb7 url("images/blue-item-bg.jpg") no-repeat right top;        }        .purple {            background: #5121b3 url("images/purple-item-bg.jpg") no-repeat right top;        }    </style>    <script>        $(document).ready(function () {            $("a").click(function () {                this.blur();            });            $("li").mouseover(function () {                $(this).stop().animate({ height: '150px' }, { queue: false, duration: 600, easing: 'easeOutBounce' })            });            $("li").mouseout(function () {                $(this).stop().animate({height:'50px'},{queue:false,duration:600,easing:'easeOutBounce'})            })        });    </script></head><body>    <p>Rollover a menu item to expand it.</p>    <ul>        <li class ="green">            <p><a href="#">Home</a></p>            <p class="subText">The front of page</p>        </li>        <li class="yellow">            <p><a href="#">About</a></p>            <p class="subText">More info</p>        </li>        <li class="red">            <p><a href="#">Contact</a></p>            <p class="subText">Get in touch</p>        </li>        <li class="blue">            <p><a href="#">Submit</a></p>            <p class="subText">Send us your stuff!</p>        </li>        <li class="purple">            <p><a href="#">Terms</a></p>            <p class="subText">Legal things</p>        </li>    </ul></body></html>


JQuery Study Notes— A small demo for Smooth Animated Menu

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.