Jquery二级简单折叠菜单
写在前面:
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>学 号:</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" >左边导航 <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">左边导航 <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" >左边导航 <span style="float:right;margin-right:74px;">></span></button>
<button type="button" >左边导航 <span style="float:right;margin-right:74px;">></span></button>
<button type="button" >左边导航 <span style="float:right;margin-right:74px;">></span></button>
<button type="button" >左边导航 <span style="float:right;margin-right:74px;">></span></button>
</div> </div>
</body>
</html>
Jquery二级简单折叠菜单的更多相关文章
- JQuery案例:折叠菜单
折叠菜单(jquery) <html> <head> <meta charset="UTF-8"> <title>accordion ...
- 一个基于jQuery的简单树形菜单
在工作中的项目使用的是一个前端基于 jQuery easyui 的一个系统,其中左侧的主菜单使用的是 easyui 中的 tree 组件,不是太熟悉,不过感觉不是太好用. 比如 easyui 中的 t ...
- jquery一个简单的菜单小插件
刚学会封装插件,先来封装一个小的菜单插件 html部分 <ul class="zong"> <li class="yiji"> < ...
- 用JQuery实现简单的菜单隐藏于切换
<锋利的JQuery>第一个demo<!DOCTYPE html> <html> <head> <meta charset="UTF-8 ...
- jQuery二级下拉菜单
在线演示 本地下载
- 第一百八十九节,jQueryUI,折叠菜单 UI
jQueryUI,折叠菜单 UI 学习要点: 1.使用 accordion 2.修改 accordion 样式 3.accordion()方法的属性 4.accordion()方法的事件 5.acco ...
- jquery垂直展开折叠手风琴二级菜单
摘要:jquery实现垂直展开二级菜单 最近新开发一个简单项目,用到左侧两级的菜单.找找了手头的文件,竟然没有现成的代码,算了,去网上找找整理下吧. 注:jquery-1.8.3.min.js需要下载 ...
- cocos2dx-lua使用UIListView制作二级折叠菜单
折叠菜单,用过jquery accordion的同学都知道是啥玩艺儿~,图片效果就是介样: cocos2dx不带有此控件,因此我们动手来实现一个. 原理很简单,展开的时候往listview里inser ...
- 原生Js_实现简单的下拉折叠菜单(添加弹出动画效果)
用javascript实现简单的下拉折叠菜单效果 实现步骤 (a)获得各操作的dom对象: (b)在所有菜单按钮对象上添加单击事件: (c)设置所有菜单按钮样式为空,并将当前按钮的样式设置为“acti ...
随机推荐
- [Android] 停止、恢复 背影音乐的播放
在执行录音操作时,我们希望可以将酷狗等后台播放的音乐停掉,在录音完成后再恢复播放,可以使用以下代码: /**@param bMute 值为true时为关闭背景音乐.*/ @TargetApi(Buil ...
- MFC多线程内存泄漏问题&解决方法
在用visual studio进行界面编程时(如MFC),前台UI我们能够通过MFC的消息循环机制实现.而对于后台的数据处理.我们可能会用到多线程来处理. 那么对于大多数人(尤其是我这样的菜鸟),一个 ...
- 使用Toad导入导出dmp数据
进入Toad,选择Database->Import->Import Utility Wizard(导入则选择:Export->Export Utility Wizard与导入类似故不 ...
- 线程间通信的三种方式(NSThread,GCD,NSOperation)
一.NSThread线程间通信 #import "ViewController.h" @interface ViewController ()<UIScrollViewDel ...
- ThinkPHP框架搭建及常见问题(Apache或MySQL无法启动)----简单的初体验
有一定基础的人勿进,这篇讲的只是零基础入门,都是我刚接触以及我所了解到的人刚开始有疑惑的地方,具体框架介绍会在后面的博客中介绍 这一篇只是为了一个简单的页面显示而介绍的方法,不涉及代码,开发环境,所以 ...
- Sql Server trace flags
Tace flag number Description -T1205 每次deadlock算法运行时,都收集相关的信息 -T1204 当deadlock算法发现死锁时才收集相关信息 -T3604 把 ...
- php中的短标签 太坑人了
今天配置了一个php页面去修改svn密码问题,结果调了半天,最后在Windows和 Linux的运行现象是不一样,运行结果更不一样了,关键是完全一模一样的代码. 最后发现是短标签引起的,Windows ...
- 创建一个基本的 Win32 窗口
#include <Windows.h> //Forward declarations bool InitMainWindow(HINSTANCE, int); LRESULT CALLB ...
- linux学习笔记之sudo
引用A:http://blog.chinaunix.net/uid-15811445-id-149961.html 引用B:http://os.51cto.com/art/201307/404879. ...
- ComboGrid 行内点击编辑内容
最近easyui需要在行内编辑选中项,但是编辑的内容出了当前选中列值,还有其他的,比较麻烦, 先看下这段代码 columns: [[ { field: 'GuestID', title: '编号', ...