竖导航下拉菜单、多级下拉菜单
来源:互联网 发布:codeblock mac 编辑:程序博客网 时间:2024/05/03 00:52
- 简单的下拉菜单
一、HTML
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>menu</title> <link rel="stylesheet" type="text/css" href="menu.css" /> <script src="../jquery.js" type="text/javascript"></script> <script src="menu.js" type="text/javascript"></script> </head> <body> <span>more</span> <ul> <li><a href="#">军事</a></li> <li><a href="#">游戏</a></li> <li><a href="#">经济</a></li> <li><a href="#">政治</a></li> <li><a href="#">新闻</a></li> <li><a href="#">娱乐</a></li> <li><a href="#">体育</a></li> </ul> </body></html>
二、CSS
/* * @Author: Marte* @Date: 2017-05-24 09:04:34* @Last Modified by: Marte* @Last Modified time: 2017-05-24 10:59:20*/*{ margin: 0; padding: 0;}img{ border:0;}ol, ul ,li{list-style: none;} body{ margin: 50px;}a{ text-decoration: none; color: red;}ul{ border: 3px solid #abcdef; width: 200px; display: none;}span{ cursor: pointer;}
三、js
/* * @Author: Marte* @Date: 2017-05-24 09:05:10* @Last Modified by: Marte* @Last Modified time: 2017-05-24 09:53:28*/$(document).ready(function(){ var opt = $('span'); var oContent = $('ul'); opt.click(function(){ // oContent.show(); oContent.slideToggle(); });});
- 竖导航菜单
一、HTML
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="menu.css" /> <script src="../jquery.js" type="text/javascript"></script> <script src="menu.js" type="text/javascript"></script> <script src="jquery.easing.1.3.js" type="text/javascript"></script> </head> <body style="background:#302b23"> <h3 id="one">kiwis</h3> <ul style="display:none"> <li><a href="#">1111</a></li> <li><a href="#">1111</a></li> <li><a href="#">1111</a></li> <li><a href="#">1111</a></li> </ul> <h3 id="one">Oranges</h3> <ul style="display:none"> <li><a href="#">2222</a></li> <li><a href="#">2222</a></li> <li><a href="#">2222</a></li> <li><a href="#">2222</a></li> </ul> <h3 id="one">Grapes</h3> <ul style="display:none"> <li><a href="#">3333</a></li> <li><a href="#">3333</a></li> <li><a href="#">3333</a></li> <li><a href="#">3333</a></li> </ul> </body></html>
二、CSS
/* * @Author: Marte* @Date: 2017-05-24 10:21:02* @Last Modified by: Marte* @Last Modified time: 2017-05-24 14:10:53*/*{ margin: 0; padding: 0;}img{ border:0;}ol, ul ,li{list-style: none;} body{ margin: 50px; color: #cccccc; position: absolute; padding-left:450px;}a{ text-decoration: none; color: blue;}a:hover{ text-decoration: underline;}h3{ cursor: pointer;}ul li{ display: block; background-color: #373128; border: 1px solid #40392C; color: #CCCCCC; margin: 5px 0; padding: 4px 18px;}#one{ display:block; width: 200px; padding:10px 20px 0; margin-top: 10px; height: 34px; font-family: Arial, Helvetica, sans-serif; background: url(../2/green.png); outline: none;}
三、js
/* * @Author: Marte* @Date: 2017-05-24 10:21:10* @Last Modified by: Marte* @Last Modified time: 2017-05-24 14:15:37*/$(document).ready(function(){ $.easing.def = 'easeOutElastic' var opt = $('h3'); opt.click(function(){ $(this).next('ul').slideToggle().siblings('ul').slideUp(); });});
3. 多级下拉菜单
一、HTML
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="menu.css" /> <script src="../jquery.js" type="text/javascript"></script> <script src="menu.js" type="text/javascript"></script> </head> <body> <ul> <li class="menuLevel1 menu"> <span>一级菜单</span> <ul class="hide"> <li class="menuLevel2 menu"> <span>二级菜单</span> <ul class="hide"> <li class="menuLevel3 menu"> <span>三级菜单</span> <ul class="hide"> <li class="menuLevel4 menu"> <span>四级菜单</span> <ul class="hide"> <li class="menuLevel5 menu"> <span>五级菜单</span> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </body></html>
二、CSS
/* * @Author: Marte* @Date: 2017-05-24 14:16:01* @Last Modified by: Marte* @Last Modified time: 2017-05-24 15:23:45*/*{ margin: 0; padding: 0;}img{ border:0;}ol, ul ,li{list-style: none;} body{ margin: 50px; position: relative;}.hide{ display: block;}.menu{ cursor: pointer;}
三、js
/* * @Author: Marte* @Date: 2017-05-24 14:16:10* @Last Modified by: Marte* @Last Modified time: 2017-05-24 15:19:20*/$(document).ready(function(){ var menu = $('.menu'); menu.hover(function(){ $(this).children('ul').show(); },function(){ $(this).children('ul').hide(); });});
阅读全文
0 0
- 竖导航下拉菜单、多级下拉菜单
- 竖导航下拉菜单、多级下拉菜单
- 导航多级下拉菜单
- 多级下拉菜单导航制作
- 多级下拉菜单(动态)
- CSS多级下拉菜单
- bootstrap2 多级下拉菜单
- 多级下拉菜单
- 多级下拉菜单插件
- bootstrap多级下拉菜单
- 多级下拉菜单
- Bootstrop多级下拉菜单
- iOS 多级下拉菜单
- jquery 导航菜单 下拉菜单
- jQuery响应式多级下拉导航菜单特效
- 精致导航下拉菜单
- 下拉式导航菜单
- DedeCMS导航下拉菜单
- Linux基础-2
- java开发微信获取网页授权凭证
- 竖导航下拉菜单、多级下拉菜单
- hibernate 的sql语句以及hql语句增删改查
- 图片裁剪框修改的方法simplecropview
- 竖导航下拉菜单、多级下拉菜单
- 使用apache common math 中的聚类方法DBSCAN与Kmeans
- 操作系统(Operating System)9 单处理器调度
- Django权限机制的实现
- (首页上一页下一页尾页 + 下拉框跳转)分页功能
- 初探 iOS 内存管理
- ORM还有一支 EF的增删改
- JVM内存空间管理
- maven新手学习教程