写在前面:

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. Base64编码和解码算法

    Base64么新鲜的算法了.只是假设你没从事过页面开发(或者说动态页面开发.尤其是邮箱服务),你都不怎么了解过,仅仅是听起来非常熟悉. 对于黑客来说,Base64与MD5算法有着相同的位置.由于电子邮 ...

  2. UVA 10806 Dijkstra, Dijkstra.

    题意: 从起点走到终点,然后从终点走到起点,其中不能同时走过相同的一条边,问你最小路径长度.先输入终点n,起点为1,接下来输入m,代表有m条边.每条边由起点,终点,长度组成. 分析: 求最小长度,还限 ...

  3. sql 随机数

    select FLOOR(rand()*16) 就是随机得到0到15之间的一个整数 select CEILING(rand()*15) 就是随机得到1到15之间的一个整数 FLOOR()为地板函数,取 ...

  4. dojo.io.script

    dojo.io.script 定义: 跨域访问数据,可以动态的将script标签插入到网页当中. 局限: 1.只支持get方式访问: 2.只支持异步调用. 使用: 1.dojo.io.script.g ...

  5. win7系统64位plsql的设置

    1. Instant Client Downloads for Microsoft Windows (32-bit) 我下载的是: instantclient-basic-win32-11.2.0.1 ...

  6. javascript 高级程序设计学习笔记(面向对象的程序设计)继承

    ECMAScript中描述了原型链的概念,原型链是实现继承的主要方法. 实现原型链继承有一种基本模式 function SuperType () { this.property = true; } S ...

  7. Unicode-字符编码的历史由来(转)

    http://www.nowamagic.net/internet/internet_CharsetHistory.php 很久很久以前,有一群人,他们决定用8个可以开合的晶体管来组合成不同的状态,以 ...

  8. humble number(hd1058)

    Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The ...

  9. Asp.net MVC4 下二级联动

    效果图:

  10. 用 for/in 在 Java 5.0 中增强循环

    这个方便的构造提供了什么?什么时候适用于代码? Brett McLaughlin (brett@newInstance.com), 作者/编辑, O'Reilly Media, Inc. 简介: fo ...