Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery hide().fadeIn() adds style="display:block"

I'm using the following line of code to fade in the new row in the table:

$('table tr:last').after($(data.row).hide().fadeIn('fast'));

This row (tr) when faded in has the style of display:block assgined to it - and that screws things up in some of the browsers making the row narrower than the other rows.

Any suggestions on how to avoid this happening?

Here's what I'm getting :

<tr style="display: block;">
like image 902
user398341 Avatar asked Jan 20 '23 05:01

user398341


1 Answers

you could tag on : .css('display', 'table-row') to ensure that ie 7 set's the display properly

$('table tr:last').after($(data.row).hide().fadeIn('fast').css('display', 'table-row'));

here's a fiddle showing it in action:

http://jsfiddle.net/xS9rF/

like image 129
Patricia Avatar answered Feb 07 '23 19:02

Patricia