写在前面:

1、前端新手

2、欢迎交流

3、

源代码百度云页面示例链接: http://pan.baidu.com/s/1nt0yjd3

链接失效请留言

效果图:

代码部分:jquery部分:

<script>
$(function(){
$("#1,#2").toggle(
function(){
var ss=$(this).attr("id");
$(this).children().parent().next().slideDown(1000);
},
function(){
$(this).children().parent().next().hide(500);
});
}); </script>

HTML部分:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
html{
padding:0px;margin:0px;}
body{
padding:0px;margin:0px;background-color:#f1f2f2;}
a{
text-decoration:none;}
a:hover{
text-decoration:none;
} #left{
float:left;width:210.4px; background-color:#1d6ab2;}
#main{
float:left;width:84.4%;position:absolute;left:210.4px;}
#left table{
margin-left:20px;margin-right:auto;margin-top:4px; text-align:left;}
#left table td{
color:#FFF;font-size:14px;font-family:宋体; font-weight:400;}
#left table td a{
color:#1d6ab2;font-size:12px;font-family:宋体; font-weight:400; background-color:#fff;
border-radius:4px;padding:5px;}
#left table td a:hover{
background-color:#1d6ab2;color:#FFF;
}
#left table td button{
background:#3f85c0;color:#fff;border:0px;padding:6px;border-radius:4px;font-size:12px;
}
#left table td button:hover{
background:#2e2d80;
}
#menu{
width:100%; margin-left:auto; margin-right:auto;margin-bottom:4px;}
#menu1,#menu2{
width:144px;display:none;margin-left:auto; margin-right:auto;clear:left;margin-bottom:3px;margin-top:3px;}
#menu button{
width:100%;height:30px;border:0px;margin:0px 0px 0px 0px; background-color:#1D6ab2;color:#FFF;
font-size:14px;font-family:宋体; font-weight:600;border-radius:1px;
}
#menu button:hover{
background-color:#f1f2f2;color:#1D6ab2;
}
#menu1 a,#menu2 a{
font-size:14px;font-family:宋体; font-weight:600;padding:0px 50px 0px 50px;
background-color:#f1f2f2;color:#1D6ab2; text-align:center;}
#menu1 a:hover,#menu2 a:hover{
background-color:#AAD5E8;color:#1D6ab2;
} </style>
<script src="js/jquery.min.js"></script> </head> <body>
<div id="left" >
<table>
<tr><td>用户名:</td><td>李丽</td></tr>
<tr><td>学&nbsp; 号:</td><td>12</td></tr>
<tr height="30px"><td ><a href="#">[修改资料]</a></td>
<td><a href="#">[修改密码]</a></td></tr>
<tr ><td><button type="button">切换账户</button></td>
<td><button type="button">用户登录</button></td></tr>
</table>
<hr style="border:1px solid #f1f2f2;height:0px;"> <div id="menu" >
<button type="button" id="1" >左边导航&nbsp;&nbsp;&nbsp;<span style="float:right;margin-right:74px;">></span></button>
<div id="menu1">
<a href="#">text2</a><br>
<a href="#">text2</a><br>
<a href="#">text2</a><br>
<a href="#">text2</a><br>
</div>
<button type="button" id="2">左边导航&nbsp;&nbsp;&nbsp;<span style="float:right;margin-right:74px;">></span></button>
<div id="menu2">
<a href="#">text2</a><br>
<a href="#">text2</a><br>
<a href="#">text2</a><br>
<a href="#">text2</a><br>
</div>
<button type="button" >左边导航&nbsp;&nbsp;&nbsp;<span style="float:right;margin-right:74px;">></span></button>
<button type="button" >左边导航&nbsp;&nbsp;&nbsp;<span style="float:right;margin-right:74px;">></span></button>
<button type="button" >左边导航&nbsp;&nbsp;&nbsp;<span style="float:right;margin-right:74px;">></span></button>
<button type="button" >左边导航&nbsp;&nbsp;&nbsp;<span style="float:right;margin-right:74px;">></span></button>
</div> </div>
</body>
</html>

Jquery二级简单折叠菜单的更多相关文章

  1. JQuery案例:折叠菜单

    折叠菜单(jquery) <html> <head> <meta charset="UTF-8"> <title>accordion ...

  2. 一个基于jQuery的简单树形菜单

    在工作中的项目使用的是一个前端基于 jQuery easyui 的一个系统,其中左侧的主菜单使用的是 easyui 中的 tree 组件,不是太熟悉,不过感觉不是太好用. 比如 easyui 中的 t ...

  3. jquery一个简单的菜单小插件

    刚学会封装插件,先来封装一个小的菜单插件 html部分 <ul class="zong"> <li class="yiji"> < ...

  4. 用JQuery实现简单的菜单隐藏于切换

    <锋利的JQuery>第一个demo<!DOCTYPE html> <html> <head> <meta charset="UTF-8 ...

  5. jQuery二级下拉菜单

    在线演示 本地下载

  6. 第一百八十九节,jQueryUI,折叠菜单 UI

    jQueryUI,折叠菜单 UI 学习要点: 1.使用 accordion 2.修改 accordion 样式 3.accordion()方法的属性 4.accordion()方法的事件 5.acco ...

  7. jquery垂直展开折叠手风琴二级菜单

    摘要:jquery实现垂直展开二级菜单 最近新开发一个简单项目,用到左侧两级的菜单.找找了手头的文件,竟然没有现成的代码,算了,去网上找找整理下吧. 注:jquery-1.8.3.min.js需要下载 ...

  8. cocos2dx-lua使用UIListView制作二级折叠菜单

    折叠菜单,用过jquery accordion的同学都知道是啥玩艺儿~,图片效果就是介样: cocos2dx不带有此控件,因此我们动手来实现一个. 原理很简单,展开的时候往listview里inser ...

  9. 原生Js_实现简单的下拉折叠菜单(添加弹出动画效果)

    用javascript实现简单的下拉折叠菜单效果 实现步骤 (a)获得各操作的dom对象: (b)在所有菜单按钮对象上添加单击事件: (c)设置所有菜单按钮样式为空,并将当前按钮的样式设置为“acti ...

随机推荐

  1. php接口数据加密、解密、验证签名代码实例

    php接口数据加密.解密.验证签名 代码非常easy,这里就不多废话了,直接奉上代码 <?php /** * 数据加密.解密.验证签名 * @edit http://www.lai18.com ...

  2. 【Java基础】几种简单的调用关系与方法

    直接上代码吧. class lesson4AB //同一个类下的public修饰的方法A,B可以相互调用 { public void A() { B();//等价于this.B(); } public ...

  3. mono for android 学习资料

    http://www.cnblogs.com/Hua-Min/tag/Android/

  4. sql 练习(2)

    1.用Decode函数实现横表和竖表的转换 SELECT deptno DEPARTMENT_ID, COUNT(*) "部门人数", ),,,)) "超高收入人数()& ...

  5. PHP基础之 file_get_contents() 函数

    定义和用法 file_get_contents() 函数把整个文件读入一个字符串中. 和 file() 一样,不同的是 file_get_contents() 把文件读入一个字符串. file_get ...

  6. VS2010编译时出现错误1 error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    需要下载VS2010的补丁包

  7. U - stl 的 优先队列 Ⅰ

    Description Given m sequences, each contains n non-negative integer. Now we may select one number fr ...

  8. dict.get('key')和dict['key']的区别

    dict['key']只能获取存在的值,如果不存在会触发KeyError dict.get('key', default=None)如果不存在,返回一个默认值

  9. 'adb' 不是内部或外部命令,也不是可运行的程序

    启动adb shell的时候,出现如下问题: 'adb' 不是内部或外部命令,也不是可运行的程序或批处理文件. 在确保自己的SDK安装正确的时候,就很好办了,找到SDK安装目录\platform-to ...

  10. UI原则之-拼车

    1.简洁------------一目了然,简洁明了 2.易用------------操作方便 3.直观.快速-------快速定位到所需信息 4.友好-------网络延时.超时.等待 5.易懂--- ...