アニメーションしている要素だけを取得。box2はアニメーション中に選択されればborderが太くなる。
サンプル
実行結果
Javascript
$('.jqTest div').each(function(i){
$(this).css({
width: 80,
height: 80,
border: '1px solid #555555',
backgroundColor: '#EEFFFF',
display: 'inline-block',
margin: 10
});
});
var ani = {};
ani.f1 = function() {
$('.box1').slideToggle('slow', ani.f1);
}
ani.f1();
$('.btn2').click(function(){
$('.box2').toggle('slow');
});
$('.btn3').click(function(){
$(':animated', '.jqTest').css({ border: '5px solid #990000' });
});
HTML
<button class="btn2">box2 run</button>
<button class="btn3">select :animated</button>
<div class="jqTest">
<div class="box1">box1</div>
<div class="box2">box2</div>
<div class="box3">box3</div>
</div>