/*
* file: /css/style.css
* I usually keep my css rules on one line for easier reading.
*/
/* main list style */
ul#nav {
list-style:none;
padding:0;
margin:15px 15px 15px 0;
width: 280px;
}
/* heading links */
ul#nav li label {
height: 30px;
line-height:30px;
background:#F9F9F9;
border-bottom: 1px solid #b9b09d;
border-top: 1px solid #C8C8C8;;
text-decoration:none;
color: #000;
}
/* heading links hover effect */
ul#nav li label:hover {
background:#FFF;
}
/* sub heading list */
ul#nav ul {
display: none;
list-style-type:none;
padding:0;
margin: 0px 0px 0px 20px;
}
/* sub heading links */
ul#nav ul li a {
display:block;
height: 24px;
line-height:25px;
background:#F9F9F9;
text-decoration:none;
border-bottom: 1px solid #d7d1c6;
font-size:10px;
color: #000;
}
/* sub heading links hover effect */
ul#nav ul li a:hover {
background:#FFF;
}
JavaScript
// execute only when the whole document is ready
$(function() {
// hide all sub heading lists
//$('#testnav li ul').hide();
// add a click handler to the heading links
$('#testnav li label').click(function(){
// if the current sub heading list is already open
if($(this).next('ul:visible').length) {
// close the sub heading list
$(this).next('ul:visible').slideUp();
} else {
// close all open sub heading lists
//$('#testnav li ul:visible').slideUp();
// slide open the next list
$(this).next('ul').slideToggle('fast');
}
// return false to stop link following the href
return false;
});
});
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.