I have noticed a common feature on many websites, but I am unsure of how to explain it.
At times, there are sliding elements in the navigation, like an arrow under menu items that moves when the user hovers over different links.
Here is an example of a simple menu:
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link number 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link something 4</a></li>
<li><a href="#">Link 5</a></li>
</ul>
Along with some jQuery (though achieving the same effect with simple CSS :hover is possible):
jQuery('ul li a').hover(function() {
jQuery('a').removeClass('active');
jQuery(this).addClass('active');
});
There is also a working jsfiddle provided:
Currently, the background color changes to red on hover. I would like this background to smoothly slide and transform (width) between these buttons as I hover.
How can I achieve something like this? I have searched for tutorials without luck.
Thank you!