画像をアニメーション化して大きくしようとしています。サイズを変えてもらいましたが、周りの要素が動かないようにしようとしています。私はアニメーションを行うためにjQueryを使用していますが、何らかの理由でマージンのすべてのステップが増加しません。それが終わった後にだけそれをします。jQueryのドキュメントを正しく読んだと思いました。これまでの私のコードは次のとおりです。
$(document).ready(function(){
$(".image").mouseenter(function(){
$(this).animate({height: "176px", width: "250px"},
{
step: function(now, fx) {
$(this).css("margin-left","-=0.076");
$(this).css("margin-right","-=0.084");
$(this).css("margin-bottom","-=0.152");
}
});
});
$(".image").mouseleave(function(){
$(this).animate({height: "100px", width: "174px"},
{
step: function(now, fx) {
$(this).css("margin-left","+=0.076");
$(this).css("margin-right","+=0.084");
$(this).css("margin-bottom","+=0.152");
}
});
});
});