私の関数はmouseleave()
、最初のイベントではなく 2 番目のイベントをトリガーしているためnth-child(1)
、プロパティをnth-child(2)
bottom:99px
mouseleave()
bottom:94px
いくつかの調査の結果、(この)ステートメントを閉じて、2回目の引数で呼び出したときに新しいスコープ内で機能するようにする必要があると確信しています..?
$(document).ready(function(){
$('#rows').on('mouseenter', "div.row div:nth-child(1), div.row div:nth-child(2)",this , function() {
$('img',this).stop().animate({"bottom":"0px"}, "fast");
});
$('div',this).off("mouseleave").on("mouseleave", function() {
$('img',this).stop().animate({"bottom":"94px"}, "fast");
});
// need closure here?
$('#rows').on('mouseenter', "div.row div:nth-child(3), div.row div:nth-child(4)",this , function() {
$('img',this).stop().animate({"bottom":"0px"}, "fast");
});
$('div',this).off("mouseleave").on("mouseleave", function() {
$('img',this).stop().animate({"bottom":"99px"}, "fast");
});
});