jquery三级导航

  • 一级菜单

    • 二级菜单
    • 二级菜单
    • 二级菜单
      • 三级菜单
      • 三级菜单
      • 三级菜单
  • 一级菜单

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title></title>

<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_732107_8hzp99uacq9.css"/>

<style type="text/css">

li {

list-style: none;

background-color: #1b1a1a;

color: #efefef;

line-height: 40px;

cursor: pointer;

}

li div:hover {

background-color: #000;

color: #fff;

box-shadow: 0 0 10px rgba(0,0,0,0.8);

text-shadow: 0 0 2px rgba(255,255,255,0.8);

}

ul {

padding-left: 0;

width: 300px;

overflow: hidden;

}

.first i {

margin-right: 4px;

font-size: 14px;

}

.second div {

padding-left: 28px;

}

.third div {

padding-left: 46px;

}

.second, .third {

display: none;

}

.qf {

float: right;

padding-right: 10px;

}

</style>

</head>

<body>

<ul class="first">

<li>

<div>一级菜单 <i class="qf qf-shop-plus"></i></div>

<ul class="second">

<li>

<div>二级菜单</div>

</li>

<li>

<div>二级菜单</div>

</li>

<li>

<div>二级菜单 <i class="qf qf-shop-plus"></i></div>

<ul class="third">

<li><div>三级菜单 </div></li>

<li><div>三级菜单 </div></li>

<li><div>三级菜单 </div></li>

</ul>

</li>

</ul>

</li>

<li>

<div> 一级菜单 <i class="qf qf-shop-plus"></i></div>

<ul class="second">

<li>

<div>二级菜单 <i class="qf qf-shop-plus"></i></div>

<ul class="third">

<li><div>三级菜单 </div></li>

<li><div>三级菜单 </div></li>

</ul>

</li>

</ul>

</li>

</ul>

<!-- <script type="text/javascript" src="jquery.js" ></script> -->

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>

<script type="text/javascript">

$(‘.first>li‘).on(‘click‘,function(){

$(this).find(‘.second‘).slideToggle();

event.stopPropagation();

})

$(‘.second>li‘).on(‘click‘,function(){

$(this).find(‘.third‘).slideToggle();

event.stopPropagation();

})

$("li").on(‘click‘, function() {

event.stopPropagation();

})

$("li:has(ul)").on(‘click‘,function(){

var i = $(this).children(‘div‘).children(‘i‘);

i.toggleClass(‘qf-shop-plus‘).toggleClass(‘qf-shop-jianhaocu‘);

})

</script>

</body>

</html>

    • 二级菜单

      • 三级菜单
      • 三级菜单

原文地址:https://www.cnblogs.com/yunshangwuyou/p/9265142.html

时间: 2024-08-07 03:35:47

jquery三级导航的相关文章

jquery三级导航,级联菜单精简

这是使用jQuery编辑的二级导航栏,效果是这样的. 而事实上,关于样式部分完全可以自由布局和修改,只要结构正确就行. 1.下面是html部分 <ul id="nav"> <li><a href="#">一级导航1</a></li> <li><a href="#">一级导航2</a> <ul> <li><a href=&q

jquery实现的三级导航菜单实例代码

jquery实现的三级导航菜单实例代码:使用最多的可能是二级导航菜单,所以网上的代码一大堆,三级菜单的代码也很多,不过相对较少一些,本章节通过一个代码实例详细介绍一下三级导航菜单的实现过程,代码如下: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta nam

用css实现三级导航菜单

主要使用css的hover伪类来实现该功能. 主要思路:先搭出三级菜单的框架,然后使用css的:hover来实现! 代码如下: <!doctype html> <html> <head> <meta charset="utf-8"> <title>三级导航菜单</title> <style type="text/css"> body{font-size: 12px;} .menu1,

jQuery实现导航栏

参考:jQuery权威指南jQuery初步jQuery选择器jQuery操作domjQuery操作dom事件jQuery插件jQuery操作AjaxjQuery动画与特效jQuery实现导航栏jQuery实现点击式选项卡jQuery实现select三级联动 实现效果: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 4

HTML练习_三级导航

1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <style type="text/

分享jQuery&amp;CSS3导航标签切换效果

jquery+css3完成的菜单导航特效 引入代码: <link rel="stylesheet" type="text/css" href="css/style.css"/> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="t

30个实用的jQuery选项卡/导航教程推荐

很多网站设计中都使用了选项卡(tabs),在制作选项卡时应用jQuery能够实现很多炫酷的过渡和动画效果.本文为你介绍30个实用的jQuery选项卡教程,希望对你有帮助. 1. Animated Tabbed Content With jQuery 选项卡被现代网站普遍应用,但大多数形式呆板.本教程逐步为你讲授如何实现选项卡动画切换效果. 示例 2. Tab Navigation with Smooth Horizontal Sliding Using jQuery 本教程为你展示如何创建一个水

jQuery滑动导航菜单

<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8" /> <meta name="author" content="abangsir" /> <title>jQuery弹性滑动导航菜单</title> <style type="text/css"> body{ font-famil

三级导航

三级导航 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> * { margin: 0; padding: 0; } .qq { width:1050px; height: 50px; border: 1px solid #ccc; margin