So im new to jquery and I want to make a new navigation menu. I want this jquery script to color my list items randomly in a variety of colors of my choosing. Lets just say red, yellow, green, blue and black. Also it should not be possible to have the same color before and after a color is selected.
Further more I want this menu to have a hover function, so that once you hover one of the list items, all the other list items get the color of grey or another css value.
I hope someone could help me build this.
I know I haven't done much yet.
HTML:
<div id="wrapper">
<div id="nav">
<ul id="navigation">
<li>Home</li>
<li>About</li>
<li>Products</li>
<li>Blog</li>
<li>Contact</li>
</ul>
</div>
</div>
Jquery:
$(document).ready(function() {
$('#navigation, li').addClass('blue');
});
CSS:
* {
margin:0px; padding:0px;
}
body {
background-color:#999;
}
#wrapper {
width:960px; margin:auto; background-color:#CCC;
}
.blue {
color:#567;
}
Demo on jsfiddle, link: http://jsfiddle.net/iBertel/vbpXP/11/