亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

我的四級(jí)菜單練習(xí)

Original 2019-02-10 13:26:51 243
abstract:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>四級(jí)下拉菜單</title> <script type="text/javascript" src="jquery-3.3.1.min.js"&g

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>四級(jí)下拉菜單</title>

<script type="text/javascript" src="jquery-3.3.1.min.js"></script>

<style type="text/css">

*{margin: 0px;padding: 0px;}

.menu { width: 800px;height: 35px;margin: 0px auto;background: pink; margin-top: 20px;color: #fff; border:1px solid  green;border-radius: 6px; }

    ul{ list-style: none;}

    ul li {width: 100px;height: 35px;line-height: 35px;text-align: center;float: left;border-right: 1px solid green;cursor: pointer;}

    .twobox li {width: 100px;height: 30px;line-height: 30px;background: pink;color: #A9A9A9; font-size: 14px;position: relative;border:0px;}

    .twobox li:hover {background: pink;color: #fff;}

    .three {position: absolute; top: 0px;left: 100px;}

    .three li {width: 99px;height: 30px;line-height: 30px;border: 0;}

    .threebox li {width: 100px;height: 30px;line-height: 30px;background: pink;color: #A9A9A9; font-size: 14px;position: relative;border:0px;}

    .threebox li:hover {background: pink;color: #fff;}

    .foure {position: absolute; top: 0px;left: 100px;}

    .foure li {width: 99px;height: 30px;line-height: 30px;border: 0;}


</style>

<script type="text/javascript">

$(document).ready(function(){

  //隱藏二級(jí)與三級(jí)下拉菜單

   $('.twobox').hide()

   $('.three').hide()

           //$('.threebox').hide()

           $('.foure').hide()

           

  //當(dāng)鼠標(biāo)移動(dòng)到包含二級(jí)菜單的一級(jí)菜單時(shí)顯示當(dāng)前二級(jí)菜單

           $('.one>li').mouseover(function(){

            $(this).find('.twobox').slideDown(500)

           })


  //當(dāng)鼠標(biāo)移出包含二級(jí)菜單的一級(jí)菜單時(shí)隱藏當(dāng)前二級(jí)菜單

           $('.one>li').mouseleave(function(){

            $(this).find('.twobox').slideUp(500)

            })


  //當(dāng)鼠標(biāo)移動(dòng)到包含三級(jí)菜單的二級(jí)菜單時(shí)顯示當(dāng)前三級(jí)菜單

            $('.two').mouseover(function(){

            $(this).find('.three').slideDown(500)

           })


  //當(dāng)鼠標(biāo)移出包含三級(jí)菜單的二級(jí)菜單時(shí)隱藏當(dāng)前三級(jí)菜單

  $('.two').mouseleave(function(){

            $(this).find('.three').slideUp(500)

            })

  

})


</script>

</head>

<body>

  <div class="menu">

            <ul class="one"><!-- 一級(jí)下拉菜單 one -->

                <li>首 頁</li>

                <li>產(chǎn) 品

                    <ul class="twobox"><!-- 二級(jí)下拉菜單 twobox-->

                        <li>產(chǎn)品1</li>

                        <li class="two">產(chǎn)品2

                            <ul class="three"><!--三級(jí)下拉菜單 three-->

                                <li>產(chǎn)品1.1</li>

                                

                                <li >產(chǎn)品1.2

                                    <ul class="threebox">

                                        <ul class="foure">

                                        <li>產(chǎn)品2.1</li>

                                        <li>產(chǎn)品2.2</li>

                                       <li>產(chǎn)品2.3</li>

                                 </ul>

                                 <ul class="foure">

                                     <li>產(chǎn)品3.1</li>

                                     <li>產(chǎn)品3.2</li>

                                     <li>產(chǎn)品3.3</li>

                                    </ul>

                                    <ul class="foure">

                                    <li>產(chǎn)品4.1</li>

                                     <li>產(chǎn)品4.2</li>

                                     <li>產(chǎn)品4.3</li>

                                    </ul>

                                </li>

                                <li >產(chǎn)品1.3</li>

                                <li >產(chǎn)品1.4"</li>

                            </ul>   

                        </li>

                        <li class="two">產(chǎn)品3

                           <ul class="three">

                                <li>產(chǎn)品3.1</li>

                                <li>產(chǎn)品3.2</li>

                                <li>產(chǎn)品3.3</li>

                                <li>產(chǎn)品3.4</li>

                            </ul>  

                        </li>

                        <li>產(chǎn)品4</li>

                    </ul>

                </li>

                <li>公司新聞

                    <ul class="twobox">

                        <li>公司新聞1</li>

                        <li class="two">公司新聞2

                            <ul class="three">

                                <li>公司新聞1.1</li>

                                <li>公司新聞1.2</li>

                                <li>公司新聞1.3</li>

                            </ul>   

                        </li>

                        <li class="two">公司新聞3

                            <ul class="three">

                                <li>公司新聞1.1</li>

                                <li>公司新聞1.2</li>

                                <li>公司新聞1.3</li>

                            </ul>   

                        </li>

                        <li class="two">公司新聞4

                             <ul class="three">

                                <li>公司新聞1.1</li>

                                <li>公司新聞1.2</li>

                                <li>公司新聞1.3</li>

                            </ul>   

                        </li>

                    </ul>

                </li>

                <li>行業(yè)新聞</li>

                <li>聯(lián)系我們</li>

            </ul>

        </div>

</body>

</html>


Correcting teacher:韋小寶Correction time:2019-02-11 10:17:00
Teacher's summary:不錯(cuò)不錯(cuò) 都寫到四級(jí)菜單了?。? 實(shí)際上下拉菜單不僅僅可以使用js來實(shí)現(xiàn) css也是可以的

Release Notes

Popular Entries