嗨,我正在尝试重新创建类似 SO 上的效果,您单击评论,页面加载,并且给定的评论背景淡出。
到目前为止我有
var theHash = window.location.hash;
$(theHash).hover(function() {
$(this).stop().animate({ backgroundColor: "#a7bf51"}, 800);
},function() {
$(this).stop().animate({ backgroundColor: "#ffffff" }, 800);
});
在悬停时效果很好,但我希望在页面准备好时自动完成。
是否有此事件,而不是使用“悬停”?谢谢