這是我如何使用jQuery hoverjQuery的懸停
懸停(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改變懸停效果不再有效。我知道住方法多次爲我解決了這樣的問題,但我該如何解決它呢?
看看我的回答,我確定了問題,並且還將您鏈接到可能幫助您實現動畫的腳本。 – Khez 2011-04-09 09:06:21