blink a row in datatable

blink a row in datatable

devksdevks Posts: 10Questions: 0Answers: 0
edited April 2011 in General
Hi All,

I am adding a new row to my datatable using fnAddData. Is there a way I can blink the newly added row for some time. Currently I am doing it by selecting the row and the changing the style to set the new background color and then changing it back to the old style class using setTimeOut. Please let me know if there is any neat way to do it.

Thanks


var tr = $('table#example tr:has(td:contains(newid))')
var oldClass = tr.attr("class");
tr.attr("class","blink");
setTimeout(blinkIt.bind(tr,oldClass),200);



blinkIt : function(oldClass){
this.attr("class", oldClass);
},

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    The way I tend to do it is to use the jQuery UI colour animation options for a smooth fade (since jQuery itself doesn't do colour animation). You've got the row from your ID, so you just need to call $().animate().

    Allan
  • devksdevks Posts: 10Questions: 0Answers: 0
    Thanks Allan !
This discussion has been closed.