1 回答
TA贡献2041条经验 获得超4个赞
为什么要jquery?原生css就能实现
大概写了个demo,你好好理解下就能改出你想要的了。
<!DOCTYPE html>
<html>
<head>
<title>菜单</title>
<meta charset="utf-8">
</head>
<style type="text/css">
#one,#two,#three,#final{
display: none;
}
.first:hover #one,
.second:hover #two,
.third:hover #three,
.first:hover #one:hover .oneone:hover #final{
display:block;
}
</style>
<body>
<ul>
<li class="first">
111
<ul id="one">
<li class="oneone">
我还可以展开
<ul id="final">
<li>11111</li>
<li>11111</li>
<li>11111</li>
</ul>
</li>
<li>11111</li>
<li>11111</li>
</ul>
</li>
<li class="second">
22
<ul id="two">
<li>11111</li>
<li>11111</li>
<li>11111</li>
</ul>
</li>
<li class="third">
33
<ul id="three">
<li>11111</li>
<li>11111</li>
<li>11111</li>
</ul>
</li>
</ul>
</body>
</html>
添加回答
举报