-1
I have an infinite scroll table, need to check if the last <tr>
of hers is WITHOUT the attribute style=display:none
. It is possible to verify ?
-1
I have an infinite scroll table, need to check if the last <tr>
of hers is WITHOUT the attribute style=display:none
. It is possible to verify ?
3
In jQuery it is possible to use
var visivel = $(elemento-ou-seletor).is(":visible");
var naoVisivel = $(elemento-ou-seletor).is(":hidden");
This checks if the element has display: none;
or not. Ignores visibility, only the attribute you refer to. Elements with opacity 0
or visibility: hidden
are not considered because technically they are part of the page render and take space.
More about the :visible
here: https://api.jquery.com/visible-selector/
0
Complementing the reply of @Sergio, you can check the last tr
table with the selector :last
jQuery:
if($("table tr:last").is(":hidden")){
// não está visível
}
If you only have 1 table on the page, the above code should work. But it is more recommended to take the table for an id or other attribute that is unique to the table, so avoid conflict if you have more than one table on the page.
For example, by id
:
<table id="tabela">
...
</table>
Selector:
$("#tabela tr:last").is(":hidden")
Browser other questions tagged javascript jquery html5 html-select
You are not signed in. Login or sign up in order to post.
it is possible to know the value that is set to
display
, that helps?– Ricardo Pontual