Why is my hidden <tr> not hidden?
I have this simple html markup created from classic asp:
<table>
<tr class="trClass">
<td>Hello </td>
</tr>
<tr class ="trClass">
<td>World!</td>
</tr>
</table>
If I set tr belonging to Hello to hide () using jQuery, it hides. Good!
But, when I use this $ ('. TrClass: visible'). each (function () {alert ('visible')}); it shows the output of "visible" twice.
Why is this?
My problem is that im filters the table in a column with a select box. But after filtering, I need to perform some calculations on the rows that are visible in the table, but now I get all the rows.
Any ideas?
/ Daniel
+5
4 answers
:visible display, :hidden, 1.3.2 :
... CSS- "none" / "", 0, 0, .
:
$('.trClass:not(:hidden)').each(function() {
alert('visible');
});
$('.trClass').each(function() {
if(!$(this).is(':hidden')) {
alert('visible');
}
});
$('.trClass').filter('not:(:hidden)').each(function() {
alert('visible');
});
hide display="none". jQuery 1.3.2 :
jQuery 1.3.2 -offset offsetWidth offsetHeight 0.
, :visible , , , CSS display none, , :hidden style="display:none", :hidden .
+13