Is there anyway to use a pseudo selector with Firefox’s querySelector() or querySelectorAll() functions to detect visibility? In particular I want to be able to do something like this:
elem.querySelector('#list .list-item:visible');
elem.querySelector('#section .sub-section:visible .title');
No need to worry about browser inconsistencies or other implementation, just Firefox. Thanks!
EDIT: Visible is defined by display not being none and visibility not being hidden.
No, there isn’t. The CSS specification doesn’t define a
:visible(or related) selector, and AFAIK Firefox doesn’t implement non-standard pseudo selectors.If you’d like to implement this yourself, note how jQuery implements its
:visibleselector:Source: http://docs.jquery.com/Release:jQuery_1.3.2#:visible.2F:hidden_Overhauled