How can I create a highlight effect above a link in the status bar, similar to what is seen on Fiddle sites? The highlight should remain above the active link and move to the link the mouse hovers over. Here is an example image of what I am trying to achieve:
The small blue line under "collaboration": https://i.sstatic.net/ya1rB.gif
$(function() {
$("li").on("mouseover mouseleave",
function () {
$("#progressbar").toggleClass("highlight");
});
setInterval("rotateimages()", 1000);
});
function rotateimages() {
var curPhoto = $("#photoShow div.current");
var nextPhoto = curPhoto.next();
if (nextPhoto.length == 0) {
return;
}
curPhoto.removeClass("current").addClass('previous');
nextPhoto.css({opacity: 0.0}).addClass('current').animate({opacity: 1.0}, 1000, function() {
curPhoto.removeClass('previous');
});
}
#logo { float: left; }
#nav {
list-style-type:none;
float:right;
}
li {
display: inline-block;
border-right: thin;
}
#progressbar{
float: right;
background-color: #D2D5D5;
height: 5px;
width: 100%;
}
.highlight {
background-color: #79CDFE;
}
.topnav {
background-color: #FEFEFE;
overflow: hidden;
}
.topnav a {
width:100%;
float: left;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
#nav a:hover {
background-color: white;
color: #79CDFE;
background-origin: : #79CDFE;
border-top: #79CDFE;
}
.topnav a.active {
background-color: white;
color: #79CDFE;
}
.status-menu {
width: 98px;
height: 5px;
background: #4EFFFF;
position: absolute;
}
body {
padding: 0px;
margin: 0px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<header>
<div class="topnav">
<div id="progressbar">
<div id="care"></div>
<div id="hospital"></div>
<div id="service"></div>
<div id="about"></div>
<div id="news"></div>
</div>
<img src="src/images/logo.png" id="logo" class="gallery"/>
<ul id="nav">
<li> <a class="active" href="#home">Home</a></li>
<li><a class="" href="#care">Link 1</a></li>
<li><a class="" href="#hospital">Link 2</a></li>
<li><a class="" href="#service">Link 3</a></li>
<li><a class="" href="#about">Link 4</a></li>
<li><a class="" href="#news">Link 5</a></li>
</ul>
</div>
</header>