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.

Custom conditional functions

Let's say you're coding away, and then the next thing is to run an event based on circumstances not covered by existing conditional functions. How would you do that in Active CSS?

You could use the @if statement, or call out to an external function using the if-func command, or you could create an Active CSS conditional function.

The @if statement

Here is a quick link to the @if statement documentation. This has a special combined syntax where you can use the ACSS built-in conditional functions alongside regular (mostly) JavaScript syntax.

Writing your own conditional function

Use the create-conditional for creating conditional functions. This is more exciting than doing it in a JavaScript function, but it will require more work to get familiar on how to do it.

Calling an external JavaScript function

See the if-func command on how to run an external function. This function should always be set up to return true or false.