首页 > 其他分享 >简洁的js和CSS3多级导航菜单

简洁的js和CSS3多级导航菜单

时间:2024-12-23 16:54:52浏览次数:3  
标签:CSS3 菜单 Custom dropdown href li Menua js class

这是一款基于bootsnav的js和CSS3多级导航菜单效果。该多级导航菜单效果在bootsnav菜单的基础上进行了美化,使效果更加炫酷。

在线预览   下载

 使用方法

在页面中引入bootstrap相关文件,jquery和bootsnav文件。

<link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/font-awesome.min.css"> <link rel="stylesheet" href="css/bootsnav.css"> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/bootstrap.min.js"></script> <script type="text/javascript" src="js/bootsnav.js"></script>                 
 HTML结构

该js和CSS3多级导航菜单的HTML结构如下:

<div class="container">     <div class="row">         <div class="col-md-12">             <nav class="navbar navbar-default navbar-mobile bootsnav on">                 <div class="navbar-header">                     <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-menu">                         <i class="fa fa-bars"></i>                     </button>                 </div>                 <div class="collapse navbar-collapse" id="navbar-menu">                     <ul class="nav navbar-nav" data-in="fadeInDown" data-out="fadeOutUp">                         <li><a href="#" data-hover="Home">Home</a></li>                         <li><a href="#" data-hover="About">About</a></li>                         <li class="dropdown">                             <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="Shortcodes">Shortcodes</a>                             <ul class="dropdown-menu animated">                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                                 <li class="dropdown">                                     <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sub Menu</a>                                     <ul class="dropdown-menu animated">                                         <li><a href="#">Custom Menu</a></li>                                         <li><a href="#">Custom Menu</a></li>                                         <li class="dropdown">                                             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sub Menu</a>                                             <ul class="dropdown-menu multi-dropdown animated">                                                 <li><a href="#">Custom Menu</a></li>                                                 <li><a href="#">Custom Menu</a></li>                                                 <li><a href="#">Custom Menu</a></li>                                                 <li><a href="#">Custom Menu</a></li>                                             </ul>                                         </li>                                         <li><a href="#">Custom Menu</a></li>                                     </ul>                                 </li>                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                             </ul>                         </li>                         <li class="dropdown">                             <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="Pages">Pages</a>                             <ul class="dropdown-menu animated">                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                                 <li class="dropdown">                                     <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sub Menu</a>                                     <ul class="dropdown-menu animated">                                         <li><a href="#">Custom Menu</a></li>                                         <li><a href="#">Custom Menu</a></li>                                         <li class="dropdown">                                             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sub Menu</a>                                             <ul class="dropdown-menu multi-dropdown animated">                                                 <li><a href="#">Custom Menu</a></li>                                                 <li><a href="#">Custom Menu</a></li>                                                 <li><a href="#">Custom Menu</a></li>                                                 <li><a href="#">Custom Menu</a></li>                                             </ul>                                         </li>                                         <li><a href="#">Custom Menu</a></li>                                     </ul>                                 </li>                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                                 <li><a href="#">Custom Menu</a></li>                             </ul>                         </li>                         <li><a href="#" data-hover="Portfolio">Portfolio</a></li>                         <li class="dropdown megamenu-fw">                             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Megamenu</a>                             <ul class="dropdown-menu megamenu-content animated" role="menu">                                 <li>                                     <div class="row">                                         <div class="col-menu col-md-3">                                             <h6 class="title">Title Menu One</h6>                                             <div class="content">                                                 <ul class="menu-col">                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                 </ul>                                             </div>                                         </div><!-- end col-3 -->                                         <div class="col-menu col-md-3">                                             <h6 class="title">Title Menu Two</h6>                                             <div class="content">                                                 <ul class="menu-col">                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                 </ul>                                             </div>                                         </div><!-- end col-3 -->                                         <div class="col-menu col-md-3">                                             <h6 class="title">Title Menu Three</h6>                                             <div class="content">                                                 <ul class="menu-col">                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                 </ul>                                             </div>                                         </div>                                         <div class="col-menu col-md-3">                                             <h6 class="title">Title Menu Four</h6>                                             <div class="content">                                                 <ul class="menu-col">                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                     <li><a href="#">Custom Menu</a></li>                                                 </ul>                                             </div>                                         </div><!-- end col-3 -->                                     </div><!-- end row -->                                 </li>                             </ul>                         </li>                         <li><a href="#" data-hover="Contact">Contact</a></li>                     </ul>                 </div>             </nav>         </div>     </div> </div>
 CSS样式

然后通过下面的CSS代码来对该js和CSS3多级导航菜单进行美化。

 

标签:CSS3,菜单,Custom,dropdown,href,li,Menua,js,class
From: https://www.cnblogs.com/mybook000/p/18624477

相关文章

  • Vue.js组件通信深度解析:构建高效、灵活的数据流
    Vue.js组件通信深度解析:构建高效、灵活的数据流引言在现代Web开发中,组件化是实现高效、可维护和可扩展代码的关键。Vue.js作为一款流行的前端框架,提供了强大的组件系统,使得开发者可以轻松地创建、注册和管理组件。然而,组件之间的通信是构建复杂应用时不可避免的问题。本文......
  • jQuery+css3制作精美的2024圣诞节倒计时页面动画HTML源码,附源码下载
    源码介绍jQuerycss3制作精美的2024年圣诞节倒计时主题页面,下着雪拉着雪橇的圣诞老人圣诞节倒计时元素动画特效。源码由HTML+CSS+JS组成,记事本打开源码文件可以进行内容文字之类的修改,双击html文件可以本地运行效果,也可以上传到服务器里面,源码下载jQuery+css3制作精美的20......
  • EasyPlayer.js视频流媒体播放器支持哪些流媒体传输协议?
    H5流媒体播放器,作为基于HTML5技术的创新产品,近年来在音频和视频播放领域取得了显著的发展。它不仅为用户提供了流畅、稳定的播放体验,还通过丰富的交互功能增强了用户的参与感。EasyPlayer是由EasyDarwin开源团队维护的一款支持RTSP、RTMP、HTTP、HLS、FLV、Webrtc等多种流媒体协......
  • EasyPlayer.js网页直播/点播播放器对H.265/H.264的播放支持体现在哪些方面?
    随着流媒体技术的迅速发展,H5将会成为了网页音视频播放的主流标准。H5提供了更安全的浏览体验,支持更多的功能,如本地存储、设备兼容和实时连接。这些特性使得H5在提供流畅的用户体验和保障用户隐私方面具有明显优势。目前,EasyPlayer.js对H.265/H.264的播放支持已经达到了一个非常......
  • 用nodejs解析gpkg文件
    在Node.js中解析GPKG文件(GeoPackage文件),需要使用支持GPKG格式的第三方库,例如better-sqlite3或sqlite3,因为GPKG文件实际上是SQLite数据库。以下是一个使用better-sqlite3库解析GPKG文件的简单示例:安装依赖首先,安装better-sqlite3依赖:npminstallbetter-......
  • node.js基于Web的大学生兼职系统程序+论文 可用于毕业设计
    本系统(程序+源码+数据库+调试部署+开发环境)带文档lw万字以上,文末可获取源码系统程序文件列表开题报告内容一、选题背景关于大学生兼职系统的研究,现有研究主要以线下兼职服务平台为主,专门针对基于Web的大学生兼职系统的研究较少。随着互联网的普及,大学生兼职方式逐渐向线上......
  • node.js毕设 调味食品城订购平台的设计与实现 论文+程序
    本系统(程序+源码+数据库+调试部署+开发环境)带文档lw万字以上,文末可获取源码系统程序文件列表开题报告内容一、选题背景关于调味食品城订购平台的设计与实现这一课题,现有研究主要以传统食品销售模式或大型综合电商平台为主,专门针对调味食品城这种特定场景下的订购平台的研......
  • node.js基于web的精品课程网站程序+论文 可用于毕业设计
    本系统(程序+源码+数据库+调试部署+开发环境)带文档lw万字以上,文末可获取源码系统程序文件列表开题报告内容一、选题背景关于精品课程网站的研究,现有研究主要以传统教育模式下的课程资源整合为主,专门针对基于web的精品课程网站的研究较少。在国内外,很多高校和教育机构都在积......
  • 网络安全宣传系统|Java|SSM|JSP| 
                            【技术栈】1⃣️:架构:B/S、MVC2⃣️:系统环境:Windowsh/Mac3⃣️:开发环境:IDEA、JDK1.8、Maven、Mysql5.7+4⃣️:技术栈:Java、Mysql、SSM、Mybatis-Plus、JSP、jquery,html5⃣️数据库可视化工具:navicat6⃣️服......
  • 纯js文字洗牌式切换特效插件
    ShuffleText是一款纯js文字洗牌式切换特效插件。该插件在鼠标滑过指定的文本时,文字会不停的逐个进行翻转,类似洗牌效果,非常炫酷。在线演示 下载 使用方法在页面中引入shuffle-text.js文件。<scriptsrc="path/to/shuffle-text.js"> HTML结构ShuffleText插件基本的HTM......