Possible Duplicate:
Class name change Event in jQuery
我正用支架在Bxsilder旁边
我需要在链接上辨识一个班级变化, 然后沿着线动画。
On page load div1 .pager-active moves the image along the line to left: 15% When next is pressed the link under div2 gets the class .pager-active and so on.
所以我需要jquery 来确认 div2 现在有班级. pager 活动, 以动画 Ing 到左: 50% 。
以下是我一直在研究的代码, 用于 div1 的初始负荷, 但没有检测到任何类别在负载后的变化 。
if( $( #div1 .pager-active ).length){
$( .line img ).animate({ left : 15% },600);
};
if( $( #div2 .pager-active ).length){
$( .line img ).animate({ left : 50% },600);
};
if( $( #div3 .pager-active ).length){
$( .line img ).animate({ left : 85% },600);
};
任何帮助都将是巨大的。