[英]how to animate remove background after hover?
鼠標懸停在元素上后,我希望以正確的方式刪除背景后,
我試過這些:
$("#store_header .right #nav ul li").hover(function() {
$(this).animate({backgroundColor : '#0097d5'}, 200);}
,function() {
$(this).animate({backgroundColor : ''}, 200);
}
);
但第二個功能不起作用,所以請告訴我錯誤是什么,什么是正確的
您需要設置要還原的顏色,請檢查工作演示 。 (注意:包括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);
}
);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.