这就是我使用jQuery 悬停的方式
悬停(handlerIn(eventObject),handlerOut(eventObject))
$(".box").each(function() {
var $this = $(this);
$this.data('baseColor', $this.css('background-color'));
$this.hover(function() {
$this.animate( {
backgroundColor : "white"
}, 50);
}, function() {
$this.animate( {
backgroundColor : $this.data('baseColor')
}, 50);
});
});
问题是当 DOM 更改时,悬停效果不再起作用。我知道live方法为我解决了很多次这样的问题,但在这种情况下我该如何解决呢?