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-visible

Syntax

if-visible: [selector];

This conditional action will return true if the selector is at least partially visible on the screen.

However, this function doesn't take into account overlaying elements. We may expand the command to include offset values, but it is what is for the moment.

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. If left empty, like :if-visible() or if-visible: "";, then it will check the event selector.

For example, this will return true if the element #myDiv is at least partially visible on the screen.

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

Note: To check if an element is fully visible on the screen, see the "if-completely-visible" conditional action.

if-visible