There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

if-display

Syntax

if-display: selector;

This conditional action will return true if the selector does not have a css display property of "none".

selector = The selector you want to check. This can be any valid CSS selector that will return one result. If more than one result is gotten from the selector, the first one will be chosen.

For example, this will return true if the element #myDiv is does not have a css display property of "none".

@conditional myDivOnScreen {
    if-display: #myDiv;
}

Note: This command uses the window.getComputedStyle function internally. For more information on this, see here:

https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle

if-display