Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I fade out this table row in IE using jQuery?

I can't get the table row to fade out in IE. It works in Chrome, but not IE. It just becomes really 'light' and stays on the screen. I tried IE8 with and without compatibility mode.

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">

function hideIt()
{
    $('#hideme').fadeTo("slow", 0.0);
}

</script>
</head>
<body>
<table>
 <tr id='hideme'>
  <td>Hide me!</td>
 </tr>
</table>
<button onclick='hideIt();'>Hide</button>
</body>
</html>

Is there a workaround/solution for a smooth fade?

like image 613
Nathan Osman Avatar asked Mar 13 '10 02:03

Nathan Osman


1 Answers

Yeah, that's a bug (feature?) in IE. If you apply it to the td elements instead of the tr, you'll get the desired effect. So,

$('#hideme>td').fadeTo("slow", 0.0);
like image 71
James Kolpack Avatar answered Nov 03 '22 01:11

James Kolpack