I have seen this on a large number of sites, but I'm not sure if I can explain it.
Sometimes there are sliding elements in navigation, just like an arrow in menu items that slides when the user hovers over different menu links, etc.
Here is 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>
And some jQuery (I know that I can get the same effect with simple css: hover):
jQuery('ul li a').hover(function() { jQuery('a').removeClass('active'); jQuery(this).addClass('active'); });
Also, working jsfiddle:
http://jsfiddle.net/8EvhK/
The background of the buttons turns red on hover. I want this background to slide and change (width) between these buttons when I hover over.
How to do something like this? I was looking for textbooks but no luck.
Thank you so much!
user1461645
source share