Navigation Bar

by fido3993

HTML

<header>
			<div class="navbar">
					<ul>
						<li style="float: left"><a href="#home">Home</a></li>
						<li><a href="#contract">Contracts</a></li>
						<li><a href="#about">About Us</a></li>
						<li><a href="#other">Other</a></li>
						<li> <a href="#release">Release Notes</a></li>
						<li> <a target="_blank" href="#">Pinnacle Health Partnership</a></li>
					</ul>
						<ul class="additional">
							<li><a target="_blank" href="#">Lloyds Pharmacy</a></li>
							<li><a target="_blank" href="#">Superdrug Pharmacy</a></li>
							<li><a target="_blank" href="#">Day Lewis Pharmacy</a></li>
					</ul>
			</div>
	</header>

CSS

body {
	background-color: #fff;
	margin: 0;
	font-family: Arial;
	color: #333;
}

header {
	background-color: #333;
	position: fixed;
	top: 0;
	width: 100%;
}

.navbar {
	display: block;
	text-align: center;
}

.navbar ul {
	list-style-type: none;
	padding: 0;
	margin: 0;

}

.navbar li {
	display: inline-block;
	vertical-align: middle;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	box-shadow: 0 0 1px rgba(0, 0, 0, 0);
	-webkit-backface-visibility: hidden;
	-moz-osx-font-smoothing: grayscale;
	position: relative;

}
.navbar li:before {
	content: "";
	position: absolute;
	z-index: -1;
	left: 50%;
	right: 50%;
	bottom: 0;
	background: white;
	height: 4px;
	-webkit-transition-property: left, right;
	transition-property: left, right;
	-webkit-transition-duration: 0.3s;
	transition-duration: 0.3s;
	-webkit-transition-timing-function: ease-out;
	transition-timing-function: ease-out;
}
.navbar .additional li:nth-child(1):before {
	background-color: #85BE40;
}
.navbar .additional li:nth-child(2):before {
	background-color: #CD006F;
}
.navbar .additional li:nth-child(3):before {
	background-color: #0088CA;
}
.navbar li:hover:before, navbar li:focus:before, .navbar li:active:before {
	left: 0;
	right: 0;
}

.navbar li a {
	padding: 25px;
	display: block;
	height: 100%;
	color: white;
	text-decoration: none;
}

.title {
	height: 100px;
	position: absolute;
	padding: 2px;
	background-color: #fff;
}
.container {
	margin-top: 150px;
	padding-top: 50px;
}

.home {
	margin-top: 10px;
	text-align: center;
	padding: 40px !important;
}
.wrap {
	width: 100%;
	margin: 0 auto;
}
.left_col {
	float: left;
	width: 50%;
}
.right_col {
	float: right;
	width: 50%;
}
.right_col img {
	width: 80%;
	margin-top: 50px;
	border: 2px solid black;
	border-radius: 5px;
}
.left_col img {
	width: 80%;
	margin-top: 50px;
	border: 2px solid black;
	border-radius: 5px;
}

.additional {
	position: absolute;
	top: 100%;
	width: 100%;
	background-color: #3D3D3D;
	display:...

JavaScript

var childHovered = false;
  
  $('.navbar ul li:nth-child(2) a').hover(function() {
		$(".additional").slideDown();
	},
  function() {
  	if (!childHovered) {
    	$(".additional").slideUp();
    }
  });
  
  $(".additional").hover(function() {
    childHovered = true;
  },
  function() {
  	$(this).slideUp();
    childIsNotHovered = false;
  });