Reputation: 1479
i want the right way to remove background after setting it when mouse over an element,
i tried these :
$("#store_header .right #nav ul li").hover(function() {
$(this).animate({backgroundColor : '#0097d5'}, 200);}
,function() {
$(this).animate({backgroundColor : ''}, 200);
}
);
but second function didn't work , so please tell me what's the error and what's the right
Upvotes: 1
Views: 562
Reputation: 18233
$("#store_header .right #nav ul li").hover(
function() {
$(this).animate({backgroundColor : '#0097d5'}, 200);
}, function() {
$(this).animate({backgroundColor : 'transparent'}, 200);
}
);
Upvotes: 2
Reputation: 160883
You need to set a color to revert , check the working demo. (note: included jquery-ui)
$("#store_header .right #nav ul li").hover(function() {
$(this).animate({backgroundColor : '#0097d5'}, 200);
} ,function() {
$(this).animate({backgroundColor : '#fff'}, 200);
}
);
Upvotes: 2