私はこの単純なHTMLを持っています:
<span class="coverImg" style="background-image:url('images/show2.jpg');"></span></a>
といくつかのJavascript:
$(function() {
$(".coverImg").hover(function() {
$(this).animate({
backgroundPosition : "0 0"
}, "fast");
}, function() {
$(this).animate({
backgroundPosition : "50% 50%"
}, "fast");
});
});
そのため、アニメーションがあまり良くなく、イージングがほとんど見られないにもかかわらず、マウスオーバー機能が正しく機能している場合..しかし、マウスアウト機能が機能していない場合、背景画像はピクセル上でも動かずにそこに座っています...
どうしたの?私は何を逃しましたか?
また:
$(function() {
$(".coverImg").mouseover(function() {
$(this)
.animate({
"background-position-x" : "-=20px",
"background-position-y" : "-=20px"
}, "fast");
}).mouseout(function() {
$(this).animate({
"background-position-x" : "0 ",
"background-position-y" : "0"
}, "fast");
})
})
これはChromeでのみ機能します...
だから再び何が問題なのか!バグは何ですか!何が恋しいの?