/* Example Styles
-----------------------------------------------*/
/* General
-----------------------------------------------*/
body {
margin:50px;
font:14px/1.5em Arial, Helvetica, serif;
}
* {-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -ms-box-sizing: border-box;}
/* Left Navigation
-----------------------------------------------*/
.mainNav {
background: ;
width: 300px;
}
/* First Level */
.mainNav ul {
margin: 0;
padding: 0;
list-style: none;
border-bottom: 1px solid #444
}
.mainNav ul li {
border-top: 1px solid #444;
background: #f6f6f6;
}
.mainNav ul li a {
color: #333;
display: block;
font-size: 1.1em;
line-height: normal;
padding:12px 20px;
text-decoration:none;
}
.mainNav ul li a:hover {
background: #ccc;
text-decoration: none;
}
/* Second Level */
.mainNav ul ul {
border-bottom: none
}
.mainNav ul ul li {
border-top: 1px solid #222;
background: #;
}
.mainNav ul ul li a {
color: #333;
display: block;
font-size: 1em;
line-height: normal;
padding: 0.5em 1em 0.5em 2.5em;
}
.mainNav ul ul li a:hover {
background: #ccc;
}
/* Third Level */
.mainNav ul ul ul li {
border:none;
}
.mainNav ul ul ul li a {
padding-left:3.5em;
}
/* Accordion Button */
ul li.has-subnav .accordion-btn {
color:#333;
background:rgba(255,255,255, 0.15); font-size:16px;
}
/*.mainNav ul li.has-subnav .accordion-btn:hover {background:#ccc;}*/
@media screen and (max-width: 1024px) {
.mainNav {width: 40%;}
}
@media screen and (max-width: 700px) {
.mainNav {width: 100%;}
}
/*customized styles*/
.accordion-btn-wrap.accordion-active > a, .accordion-btn-wrap > a {padding:0!Important;}
h3.first-level-section-nav {background: #066792;
color: #ffffff;
...
JavaScript
/* Nav Accordion Plugin v1.1.2
************************************/
(function($){
$.fn.navAccordion = function(options, callback){
this.each(function(){
//Options
var settings = $.extend({
expandButtonText : "+", //Text inside of expand button
collapseButtonText: "-", //Text inside of collapse button
selectedExpand: "true", //Expand the selected channel
selectedClass: "selected", //Class that will be used to detect the currently selected channel - this will check the "parentElement" for this class (the parent <li> by default)
multipleLevels: "true", //Apply accordion to all levels - setting this to false will apply the accordion only to the first level
buttonWidth: "20%", //Width of accordion expand/collapse button as a percentage or pixels
buttonPosition: "right", //Position of button - 'right' is default - you can also choose 'left'
slideSpeed: "fast", //Speed of slide animation - "fast", "slow", or number in milliseconds such as 500
parentElement: "li", //Parent element type, class or ID - you don't need to change this if you're using a ul > li > ul pattern
childElement: "ul", //Child element type, class or ID - you don't need to change this if you're using a ul > li > ul pattern
headersOnly: false, //False is default - setting to true will make any link with sub-nav behave as if it were set to header only, making the link inaccessible - this option is useful if you are using the plugin for a non-navigation area
headersOnlyCheck: false, // False is default - set to true to apply the accordion only to links that are set as "header only" (have no href)
delayLink: false, //Delay following the href of links until after the accordion the has expanded
delayAmount: null //Time in milliseconds to delay before following href - will use "slideSpeed" by default if nothing else is set
}, options);
var container = this,
//Multiple levels variable
multi =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.