I have a table that has some rows,each row has a background. There is a button that remove specified row with jQuery fadeOut, but during the operation the design doesn't good.cells background will be white.
$(document).ready(function(){
$(".btn").click(function(){
$("#row").fadeOut();
});
});
This jsfiddle describes my problem better.
You are just hiding the row and not removing it completely. To remove the row completely from the table and also using fadeout effect use this code.
you can use
.hide()
in the place of.fadeOut()
to avoid this issue.here is the updated jsFiddle File
The below code will achieve a shrinking row and then hide it without turning the background white
Fiddle example
Animating line height doesnt go all that smoothly with webkit however.
You can also animate the
hide()
function by setting its parameter to the time taken to hideThat however also suffers from the "white background problem" since it animates the opacity.
Adapting from http://blog.slaks.net/2010/12/animating-table-rows-with-jquery.html/ gives a nice shrinking without white space in at least Chrome and Firefox
Fiddle
try this:
working fiddle here: http://jsfiddle.net/wnKXP/4/
you can set opacity in "0.7"
I hope it helps.
Just add the same background to your table which you applied for table row then you will not see any background for rows.
here is the link for jsFiddle