問題を説明するためにフィドルを作成しました: http://jsfiddle.net/E5XvT/2/
次のコードで、Jquery UI のアニメーション機能を使用して、要素の背景色をフェードインしています。
HTML:
<div id="element">
<h1>test</h1>
<div id="child">not animated</div>
<div id="child">not animated</div>
</div>
CSS:
#element {
width:300px;
margin-left:auto;
margin-right:auto;
}
#child {
background-color: blue;
width: 100px;
float: left;
}
Jクエリ:
$('#element').animate({backgroundColor: '#FFFF99'}, 'slow');
問題は、この関数がフロートされた子要素に効果を適用していないことです。フローティングを削除すると機能します
ありがとう