Web前端–折叠菜单(Jquery版)
先上效果图
背景可以自己设置。
以下是代码实现:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="//libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<style>
*{
margin: 0;
padding: 0;
}
.nav{
list-style:none;
width: 300px;
margin: 100px auto;
}
.nav>li{
border: 1px solid #000;
line-height: 35px;
border-bottom:none;
text-indent: 2em;
position: relative;
}
.nav>li:last-child{
border-bottom: 1px solid #000;
border-bottom-right-radius:10px;
border-botto