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-var-true

Syntax

if-var-true: "variable|function";

variable = a variable, function or anything in the global scope.

This conditional action will return true if an Active CSS variable in the current scope, or window[variable|function] equates to true.

You can use it to check the value a window-scoped variable or function (like if-func) from within a conditional in order to return a true or false value and determine the next action. Or you can use it to check Active CSS variable values.

As with all the conditionals, a JavaScript expression can be used when appropriate using the "{= ... =}" wrapper.

/* These three commands are all doing the same thing */
if-var-true: {= ($myGlobalBooleanVar) ? true : false =};
if-var-true: {= $myGlobalBooleanVar =};
if-var-true: $myGlobalBooleanVar;