这个下拉虽然可以下来。但是还是有点问题。麻烦老师帮忙检查一下看看问题出在哪里

Original 2018-11-25 03:26:38 182
abstract:<!DOCTYPE html><html><head><meta charset="UTF-8"><title>三级菜单</title><script type="text/javascript" src="jquery-3.3.1.js"></sc

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>三级菜单</title>

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

<style>

*{ margin: 0px;

padding: 0px;

}

body{

background-color: #ccc;

}

.box{

width: 100%;

height: 40px;

background-color: #F92672;

border-radius: 3px;

box-shadow: 0px 0px 15px;

margin-top: 10px;

}

.nav{

width: 500px;

height: 40px;

margin: 0px auto;

}

ul li{

width: 100px;

height: 38px;

box-shadow: 5px;

text-align: center;

float: left;

list-style: none;

line-height: 40px;

font-weight: bold;

color: #fff;

cursor: pointer;

}


.twobox li{

background-color: #F92672;

border:0.5px solid #fff;

border-top: 0px;

color: #ccc;

font-size: 14px;

height: 35px;

}

.twobox{

/*top:40px;*/

border-top:0.5px solid #fff;

}

ul{

position: absolute;

z-index: 20;

}

.block{

width: 100px;

height: 2px;

background-color: #fff;

top: 38px;

z-index: 10;

position: relative;

border-radius: 5px;

}

.three li{

background-color: #F92672;

border-top: 0px;

color: #ccc;

font-size: 14px;

position: relative;

border-top:0.5px solid #fff;

}

.three{

margin-top: -40px;

left: 101px;

}

.twobox li:hover {

background: #ccc;

color: #fff;}

</style>

</head>

<body>

<div>

<div>

<ul>

<li name="0">首页</li>

<li name="1">php中文网</li>

<li name="2">独孤九剑</li>

<li name="3">西门大官人</li>

<li name="4">灭绝师太

<ul>

<li>web前端

<ul>

<li>html</li>

<li>javascript</li>

<li>css</li>

</ul>

</li>

<li>PHP后台</li>

<li>thinkphp</li>

</ul>

</li>

</ul>

<div></div>

</div>


</div>


</body>

<script type="text/javascript">

$(document).ready(function(){

$(".twobox").hide()

$(".three").hide()


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

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

           })

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

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

           })


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

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

           })

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

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

           })



$("li").hover(function(){

$x=parseInt($(this).attr("name"))*100

$(".block").mouseover().animate({left:$x+"px"},200)


})

})

</script>

</html>


Correcting teacher:查无此人Correction time:2018-11-25 09:51:28
Teacher's summary:老师课程里有带着大家做。教你个最简单的,用对比软件,对比下,看看哪里缺少了。

Release Notes

Popular Entries