所以,我有这些 h1 元素是链接,我想向它们添加一个类,并在元素悬停后淡入该类,然后 onMouseOut 删除该类,同时淡化该类。但是使用淡入淡出功能对我没有任何作用。看到它隐藏了元素。有任何想法吗?
jQuery(".categories h1 a").hover(
function () {
jQuery(this).fadeIn("slow").addClass("active");
},
function(){
jQuery(this).fadeOut("slow").removeClass("active");
});
});
谢谢!
编辑:::
jQuery("h1").hover(function() {
jQuery(this).stop().animate({ backgroundColor: "#a7bf51"}, 800);
},function() {
jQuery(this).stop().animate({ backgroundColor: "#FFFFFF"}, 800);
});
});