$(':visible', this).length == 0 (Or 1, if the root of the context is
returned, which I'm not sure of.)
Note: This will be kind of inefficient if you're working with a big DOM tree.
- Brian
> Hello all,
>
> How can I check if a given element is visible or not (i.e. has
> display:block).
> I have the folowing situatioin - I need to hide all <li class="label">
> elements that have ALL their <li class="clearfix"> descendant hidden.
> (if one or more of the <li class="clearfix"> descendants is visible, then
> the
> "label" must stay visible). I intend to do sometning like that:
>
> $("div.specifications li.label").each(function() {
>
> to_hide = 1;
> $(" li.clearfix", this).each(function() {
>
> if($(this).IS_VISIBLE to_hide = 0;
> })
> if($.trim(this.innerHTML) == ' ')
> $(this).parent().parent().toggle();
>
> if(to_hide) {
>
> $(this).hide();
> }
>
> })
>
> What might IS_VISIBLE be ?
> Any hints ?
>
>
> --
> Best regards,
> Stoyan mailto:[EMAIL PROTECTED]
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/