Possible Duplicate:
Class name change Event in jQuery
I am using jquery along side bxsilder.
I need jquery to recognise a class change on a link which will then animate an image along a line.
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.
So I need jquery to recognise that div2 now has the class .pager-active there for animating the img to left:50%
Below is the code I have been working with which works on initial load for div1 but doesn't detect any class changes after load.
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);
};
Any help would be great.