3

I need to add an callback function to an css change event. Does this kind of event exists and if so, how to use it ? I tried the following but that didn't work.

$('#websites_table').find('tr').each(function(){
        $(this).css().change(function(){
            alert('changed');   
        });
    });

With friendly greetings, Bob

PeeHaa
  • 69,318
  • 57
  • 185
  • 258
Bob
  • 811
  • 9
  • 22
  • 2
    No such event that I know of. Maybe you are looking at this the wrong way...perhaps you can wire up your event to whatever is going to change the css? – Timbo Oct 19 '11 at 12:38
  • Are you changing CSS using jQuery, if yes make a function and call that after each change in CSS. hope this could help ... – Riz Oct 19 '11 at 12:38
  • 2
    I think you are looking for something like this. http://stackoverflow.com/questions/1397251/event-detect-when-css-property-changed-using-jquery – U.P Oct 19 '11 at 12:39
  • Problem is I can't do that. I use the PicNet table filter to filter the results in a table and I would rather not change the source of this plugin because of forward-compatibility. – Bob Oct 19 '11 at 12:39
  • @UmairP That is exactly what I was looking for. Thanks! – Bob Oct 19 '11 at 12:40

1 Answers1

0

Refer to: In JQuery, Is it possible to get callback function after setting new css rule?

To summarize, the css will always change before the code below runs. Ex:

$('#element').css('background', '#000000');
alert('This will run after the background changes.');
Community
  • 1
  • 1
MLM
  • 3,590
  • 3
  • 36
  • 64