本文实现了点击标题时判断该标题下的菜单是否显示,如果是显示的则将其隐藏,如果是隐藏的则将其显示出来。具体代码如下
document *{margin:0; padding:0; font-size:13px; list-style:none;} .menu{width:210px; margin:50px auto; border:1px solid #ccc;} .menu p{height:25px; line-height:25px; font-weight:bold; background:#eee; border-bottom:1px solid #ccc; cursor:pointer; padding-left:5px;} .menu div ul{display:none;} .menu li{height:24px; line-height:24px; padding-left:5px;} Web前端
- Javascript
- DIV+CSS
- jQuery
后台脚本
- PHP
- ASP.net
- JSP
前端框架
- Extjs
- Esspress
- YUI
实例效果:
以上就是为大家分享的javascript伸缩菜单栏实现代码,希望对大家的学习有所帮助。



