Javascript 如何在悬停后设置移除背景的动画?
我想在鼠标移到元素上设置背景后,用正确的方法移除背景 我试过这些:Javascript 如何在悬停后设置移除背景的动画?,javascript,jquery,jquery-ui,Javascript,Jquery,Jquery Ui,我想在鼠标移到元素上设置背景后,用正确的方法移除背景 我试过这些: $("#store_header .right #nav ul li").hover(function() { $(this).animate({backgroundColor : '#0097d5'}, 200);} ,function() { $(this).animate({backgroundColor : ''}, 200); } ); 但是第二个功能不起作用,所以请告诉我什
$("#store_header .right #nav ul li").hover(function() {
$(this).animate({backgroundColor : '#0097d5'}, 200);}
,function() {
$(this).animate({backgroundColor : ''}, 200);
}
);
但是第二个功能不起作用,所以请告诉我什么是错误,什么是正确的您需要设置要还原的颜色,请选中。(注意:包括jquery ui)
您需要设置要还原的颜色,请选中。(注意:包括jquery ui)
$("#store_header .right #nav ul li").hover(function() {
$(this).animate({backgroundColor : '#0097d5'}, 200);
} ,function() {
$(this).animate({backgroundColor : '#fff'}, 200);
}
);
$("#store_header .right #nav ul li").hover(
function() {
$(this).animate({backgroundColor : '#0097d5'}, 200);
}, function() {
$(this).animate({backgroundColor : 'transparent'}, 200);
}
);