I am using the jQuery function .animate to highlight navigation links one by one. They are in a ul. I can get this to work, just wondering if there is a way to shorten my code so that I don't have to highlight each item individually. Thanks in advance
$(document).ready(function(){
$('#button1').mouseenter(function(){
$(this).animate({
color:"#FFFFFF",
backgroundColor: "#FF9B05"
});
});
$('#button1').mouseleave(function(){
$(this).animate({
color:"#FF9B05",
backgroundColor: "#FFFFFF"
});
});
$('#button2').mouseenter(function(){
$(this).animate({
color:"#FFFFFF",
backgroundColor: "#FF9B05"
});
});
$('#button2').mouseleave(function(){
$(this).animate({
color:"#FF9B05",
backgroundColor: "#FFFFFF"
});
});
$('#button3').mouseenter(function(){
$(this).animate({
color:"#FFFFFF",
backgroundColor: "#FF9B05"
});
});
$('#button3').mouseleave(function(){
$(this).animate({
color:"#FF9B05",
backgroundColor: "#FFFFFF"
});
});
$('#button4').mouseenter(function(){
$(this).animate({
color:"#FFFFFF",
backgroundColor: "#FF9B05"
});
});
$('#button4').mouseleave(function(){
$(this).animate({
color:"#FF9B05",
backgroundColor: "#FFFFFF"
});
});
});